-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.dukescript
46 lines (42 loc) · 1.6 KB
/
.dukescript
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
#!groovy
node ('Mac') {
stage('Build') {
checkout scm
jdk = tool name: 'JDK8u221'
env.JAVA_HOME = "${jdk}"
if (env.GPG_DIR) {
env.PATH="${env.PATH}:${env.GPG_DIR}"
}
pom = readFile 'pom.xml'
if (pom.contains('-SNAPSHOT</version>')) {
integrationTests = true
} else {
integrationTests = false
}
if (env.ANDROID_HOME) {
mvnargs =" -Dandroid.sdk.path='${env.ANDROID_HOME}'"
}
withMaven(
maven : 'M3',
mavenSettingsConfig : '1745afa9-9479-4838-b15d-14029f4cfc8d'
) {
withCredentials([file(credentialsId: 'PRIVATE_KEY', variable: 'KEY')]) {
sh "gpg --batch --import ${env.KEY}"
sh "gpgconf --kill gpg-agent"
sh "gpg-agent --daemon --allow-preset-passphrase --batch"
if (env.GPG_PASSPHRASE) {
withCredentials([usernamePassword(credentialsId: 'd0aa9e41-82e0-4562-bb67-b42364e8aa35',
passwordVariable: 'GPG_PASSWD', usernameVariable: 'GPG_ID')
]) {
sh "${env.GPG_PASSPHRASE} --preset --passphrase ${GPG_PASSWD} ${GPG_ID}"
}
}
sh "mvn ${mvnargs} clean deploy -Prelease -Dgpg.useagent=true"
sh "mvn ${mvnargs} -DskipTests javadoc:aggregate -Dgpg.useagent=true"
if (integrationTests) {
sh "mvn ${mvnargs} -f testing verify -Dgpg.useagent=true"
}
}
}
}
}