-
Notifications
You must be signed in to change notification settings - Fork 12
/
Jenkinsfile
101 lines (97 loc) · 3.41 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
pipeline {
agent {
kubernetes {
yamlFile 'jenkins/pod-templates/cdt-full-pod-plus-eclipse-install.yaml'
}
}
options {
timestamps()
disableConcurrentBuilds()
}
stages {
stage('initialize PGP') {
steps {
container('cdt') {
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('Install clangd') {
steps {
container('cdt') {
timeout(activity: true, time: 30) {
sh 'curl -L https://github.com/clangd/clangd/releases/download/15.0.6/clangd-linux-15.0.6.zip > clangd.zip'
sh 'unzip clangd.zip'
}
}
}
}
stage('Build and verify') {
steps {
container('cdt') {
timeout(activity: true, time: 20) {
withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=60.0']) {
withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
sh '''
export PATH=$PWD/clangd_15.0.6/bin:$PATH
which clangd
clangd --version
/jipp/tools/apache-maven/latest/bin/mvn \
clean verify -B -V -e \
-Dmaven.test.failure.ignore=true \
-Dgpg.passphrase="${KEYRING_PASSPHRASE}" \
-P baseline-compare-and-replace \
-P api-baseline-check \
-P production \
-Dmaven.repo.local=/home/jenkins/.m2/repository \
--settings /home/jenkins/.m2/settings.xml \
'''
}
}
}
}
}
}
stage('Deploy Snapshot') {
steps {
container('jnlp') {
timeout(activity: true, time: 20) {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
SSHUSER="[email protected]"
SSH="ssh ${SSHUSER}"
SCP="scp"
DOWNLOAD=download.eclipse.org/tools/cdt/builds/cdt-lsp/$BRANCH_NAME
DOWNLOAD_MOUNT=/home/data/httpd/$DOWNLOAD
# Deploying build to nightly location on download.eclipse.org
if $SSH test -e ${DOWNLOAD_MOUNT}-new; then
$SSH rm -r ${DOWNLOAD_MOUNT}-new
fi
if $SSH test -e ${DOWNLOAD_MOUNT}-last; then
$SSH rm -r ${DOWNLOAD_MOUNT}-last
fi
$SSH mkdir -p ${DOWNLOAD_MOUNT}-new
$SCP -rp releng/org.eclipse.cdt.lsp.repository/target/repository/* "${SSHUSER}:"${DOWNLOAD_MOUNT}-new
if $SSH test -e ${DOWNLOAD_MOUNT}; then
$SSH mv ${DOWNLOAD_MOUNT} ${DOWNLOAD_MOUNT}-last
fi
$SSH mv ${DOWNLOAD_MOUNT}-new ${DOWNLOAD_MOUNT}
'''
}
}
}
}
}
}
post {
always {
container('cdt') {
archiveArtifacts '**/*.log,releng/org.eclipse.cdt.lsp.repository/target/**'
junit '**/target/surefire-reports/*.xml'
}
}
}
}