-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
79 lines (78 loc) · 2.37 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
pipeline {
options {
timeout(time: 240, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'5'))
disableConcurrentBuilds(abortPrevious: true)
timestamps()
}
agent {
label "centos-latest"
}
tools {
maven 'apache-maven-latest'
jdk 'temurin-jdk21-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('Deploy eclipse-platform-parent pom and eclipse-sdk target') {
when {
anyOf {
branch 'master'
branch 'R*_maintenance'
branch 'prepare_R*'
}
}
steps {
sh 'mvn clean deploy -f eclipse-platform-parent/pom.xml'
sh 'mvn clean deploy -f eclipse.platform.releng.prereqs.sdk/pom.xml'
}
}
stage('Build') {
when { not { branch pattern: "prepare_R.*", comparator: "REGEXP" } }
steps {
withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
sh '''
if [[ ${BRANCH_NAME} == master ]] || [[ ${BRANCH_NAME} =~ ^R[0-9]_[0-9]+_maintenance ]]; then
MVN_ARGS="-Peclipse-sign"
else
MVN_ARGS=
export KEYRING="deadbeef"
export KEYRING_PASSPHRASE="none"
fi
mvn clean install -pl :eclipse-sdk-prereqs,:org.eclipse.jdt.core.compiler.batch -DlocalEcjVersion=99.99 -Dmaven.repo.local=$WORKSPACE/.m2/repository -U
mvn clean verify -e -Dmaven.repo.local=$WORKSPACE/.m2/repository \
-Pbree-libs \
${MVN_ARGS} \
-DskipTests=true \
-Dcompare-version-with-baselines.skip=false \
-DapiBaselineTargetDirectory=${WORKSPACE} \
-Dgpg.passphrase="${KEYRING_PASSPHRASE}" \
-Dcbi-ecj-version=99.99 \
-U
'''
}
}
post {
always {
archiveArtifacts allowEmptyArchive: true, 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/*'
}
}
}
}
}