This repository was archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathbuild-release.jenkins
More file actions
45 lines (35 loc) · 1.5 KB
/
build-release.jenkins
File metadata and controls
45 lines (35 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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}"
}
}
}
}
}