-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
49 lines (48 loc) · 1.53 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
49
pipeline {
options {
timeout(time: 240, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'5'))
disableConcurrentBuilds(abortPrevious: true)
}
agent {
label "centos-latest"
}
tools {
maven 'apache-maven-latest'
jdk 'openjdk-jdk17-latest'
}
stages {
stage('initialize PGP') {
steps {
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
sh 'gpg --batch --import "${KEYRING}"'
sh 'for fpr in $(gpg --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u); do echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust; done'
}
}
}
stage('Use master') {
steps {
sh 'git submodule foreach "git fetch origin master; git checkout FETCH_HEAD"'
}
}
stage('Build') {
steps {
withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
sh '''
mvn clean verify -Dmaven.repo.local=$WORKSPACE/.m2/repository \
-Pbree-libs -Peclipse-sign \
-Dmaven.test.skip=true -DskipTests=true -DaggregatorBuild=true \
-DapiBaselineTargetDirectory=${WORKSPACE} \
-Dgpg.passphrase="${KEYRING_PASSPHRASE}" \
-Dproject.build.sourceEncoding=UTF-8
'''
}
}
post {
always {
archiveArtifacts artifacts: '.*log,*/target/work/data/.metadata/.*log,*/tests/target/work/data/.metadata/.*log,apiAnalyzer-workspace/.metadata/.*log,eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/repository/*', allowEmptyArchive: true
}
}
}
}
}