@@ -28,12 +28,26 @@ spec:
28
28
- name: jnlp
29
29
image: 'eclipsecbi/jenkins-jnlp-agent'
30
30
volumeMounts:
31
- - mountPath: /home/jenkins/.ssh
32
- name: volume-known-hosts
31
+ - name: volume-known-hosts
32
+ mountPath: /home/jenkins/.ssh
33
+ - name: settings-xml
34
+ mountPath: /home/jenkins/.m2/settings.xml
35
+ subPath: settings.xml
36
+ readOnly: true
37
+ - name: m2-repo
38
+ mountPath: /home/jenkins/.m2/repository
33
39
volumes:
34
- - configMap:
40
+ - name: volume-known-hosts
41
+ configMap:
35
42
name: known-hosts
36
- name: volume-known-hosts
43
+ - name: settings-xml
44
+ secret:
45
+ secretName: m2-secret-dir
46
+ items:
47
+ - key: settings.xml
48
+ path: settings.xml
49
+ - name: m2-repo
50
+ emptyDir: {}
37
51
"""
38
52
}
39
53
}
43
57
GITHUB_API_CREDENTIALS_ID = ' github-bot-token'
44
58
}
45
59
stages {
60
+ stage(' initialize PGP' ) {
61
+ steps {
62
+ container(' container' ) {
63
+ withCredentials([file(credentialsId : ' secret-subkeys.asc' , variable : ' KEYRING' )]) {
64
+ sh ' gpg --batch --import "${KEYRING}"'
65
+ sh ' for fpr in $(gpg --list-keys --with-colons | awk -F: \' /fpr:/ {print $10}\' | sort -u); do echo -e "5\n y\n " | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust; done'
66
+ }
67
+ }
68
+ }
69
+ }
46
70
stage(' Prepare-environment' ) {
47
71
steps {
48
72
container(' container' ) {
57
81
stage(' Build' ) {
58
82
steps {
59
83
container(' container' ) {
60
- withCredentials([string(credentialsId : " ${ GITHUB_API_CREDENTIALS_ID} " , variable : ' GITHUB_API_TOKEN' )]) {
61
- wrap([$class : ' Xvnc' , useXauthority : true ]) {
62
- sh """ mvn clean verify -B -fae -Dtycho.disableP2Mirrors=true -Ddownload.cache.skip=true -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Psign -Dmaven.repo.local=$WORKSPACE /.m2/repository -Dgithub.api.token="${ GITHUB_API_TOKEN} " """
84
+ withCredentials([string(credentialsId : ' gpg-passphrase' , variable : ' KEYRING_PASSPHRASE' )]) {
85
+ withCredentials([string(credentialsId : " ${ GITHUB_API_CREDENTIALS_ID} " , variable : ' GITHUB_API_TOKEN' )]) {
86
+ wrap([$class : ' Xvnc' , useXauthority : true ]) {
87
+ sh """ mvn clean verify -B -fae -Ddownload.cache.skip=true -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Psign -Dmaven.repo.local=$WORKSPACE /.m2/repository -Dgithub.api.token="${ GITHUB_API_TOKEN} " -Dgpg.passphrase="${ KEYRING_PASSPHRASE} " """
88
+ }
63
89
}
64
90
}
65
91
}
0 commit comments