@@ -28,12 +28,26 @@ spec:
2828 - name: jnlp
2929 image: 'eclipsecbi/jenkins-jnlp-agent'
3030 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
3339 volumes:
34- - configMap:
40+ - name: volume-known-hosts
41+ configMap:
3542 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: {}
3751"""
3852 }
3953 }
4357 GITHUB_API_CREDENTIALS_ID = ' github-bot-token'
4458 }
4559 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+ }
4670 stage(' Prepare-environment' ) {
4771 steps {
4872 container(' container' ) {
5781 stage(' Build' ) {
5882 steps {
5983 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+ }
6389 }
6490 }
6591 }
0 commit comments