-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
48 lines (44 loc) · 1.5 KB
/
Jenkinsfile
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
46
47
48
pipeline {
agent any
environment {
SELENIUM_BROWSER = 'chrome'
}
stages {
stage('Build and Test only') {
when {
not {
anyOf {
branch 'main'
branch '2021.06'
branch '2021.06.x'
}
}
}
steps {
withMaven (maven: 'mvn', jdk: 'OJDK11') {
sh 'mvn -U clean verify'
}
}
}
stage('Build, Test and Deploy') {
when {
anyOf {
branch 'main'
branch '2021.06'
branch '2021.06.x'
}
}
steps {
withMaven (maven: 'mvn', jdk: 'OJDK11', mavenSettingsConfig: 'maven-deploy-settings') {
withCredentials([
usernamePassword(credentialsId: 'ossrhs01', passwordVariable: 'PASSWORD_VAR', usernameVariable: 'USERNAME_VAR'),
usernamePassword(credentialsId: 'gpg', passwordVariable: 'KEYPW_VAR', usernameVariable: 'KEYID_VAR')
])
{
sh 'mvn -U clean deploy -Dgpg.executable=gpg -Dgpg.keyname=${KEYID_VAR} -Dgpg.passphrase=${KEYPW_VAR} -Dossrhs01.username=${USERNAME_VAR} -Dossrhs01.password=${PASSWORD_VAR}'
}
}
}
}
}
}