This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Jenkins build files for snapshot and release
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// must be executed on a docker-enabled node | ||
node('docker-based-builds') { | ||
|
||
// check out branch that triggered the build | ||
stage('Checkout SCM') { | ||
checkout scm | ||
} | ||
|
||
// load build environment docker container | ||
def container = docker.image('caaqe/webtester2-build-environment:latest') | ||
container.pull() | ||
container.inside { | ||
|
||
stage('Log Tool Versions') { | ||
sh 'java -version' | ||
sh 'git --version' | ||
sh 'mvn --version' | ||
sh 'gpg --version' | ||
} | ||
|
||
stage('Set Version to $VERSION') { | ||
sh 'cd webtester-build-tools && mvn versions:set versions:commit -DnewVersion=$VERSION' | ||
sh 'mvn versions:set versions:commit -DnewVersion=$VERSION' | ||
} | ||
|
||
stage('Build & Deploy to Sonatype OSS') { | ||
// credentials for the repository are stored in Jenkins | ||
withCredentials([usernamePassword(credentialsId: 'ossrh-credentials', passwordVariable: 'ossrhPassword', usernameVariable: 'ossrhUsername')]) { | ||
// credentials for the GPG certificates are stored in Jenkins | ||
withCredentials([string(credentialsId: 'webtester-gpg-passphrase', variable: 'gpgPassphrase')]) { | ||
|
||
def skipTests = "-DskipTests=true" | ||
def gpgPassphrase = "-Dgpg.passphrase=${gpgPassphrase}" | ||
def repositoryCredentials = "-Dossrh.username=${ossrhUsername} -Dossrh.password=${ossrhPassword}" | ||
def profiles = "-P documentation,release,maven-central" | ||
|
||
sh "mvn clean deploy ${skipTests} ${gpgPassphrase} ${repositoryCredentials} ${profiles}" | ||
|
||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// must be executed on a docker-enabled node | ||
node('docker-based-builds') { | ||
|
||
// check out branch that triggered the build | ||
stage('Checkout SCM') { | ||
checkout scm | ||
} | ||
|
||
// load build environment docker container | ||
def container = docker.image('caaqe/webtester2-build-environment:latest') | ||
container.pull() | ||
container.inside { | ||
|
||
stage('Log Tool Versions') { | ||
sh 'java -version' | ||
sh 'git --version' | ||
sh 'mvn --version' | ||
sh 'gpg --version' | ||
} | ||
|
||
stage('Build & Deploy to Sonatype OSS') { | ||
|
||
// credentials for the repository are stored in Jenkins | ||
withCredentials([usernamePassword(credentialsId: 'ossrh-credentials', passwordVariable: 'ossrhPassword', usernameVariable: 'ossrhUsername')]) { | ||
|
||
def skipTests = "-DskipTests=true" | ||
def targetRepository = "-DaltDeploymentRepository=ossrh::default::https://oss.sonatype.org/content/repositories/snapshots" | ||
def repositoryCredentials = "-Dossrh.username=${ossrhUsername} -Dossrh.password=${ossrhPassword}" | ||
def profiles = "-P documentation" | ||
|
||
sh "mvn clean deploy ${skipTests} ${targetRepository} ${repositoryCredentials} ${profiles}" | ||
|
||
} | ||
|
||
} | ||
|
||
} | ||
|
||
} |