-
Notifications
You must be signed in to change notification settings - Fork 148
/
Copy pathbuild.Jenkinsfile
88 lines (88 loc) · 2.35 KB
/
build.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
pipeline {
agent {
kubernetes {
// See comment in deplog-build.sh (gpg:sign-and-deploy-file)
inheritFrom 'centos-7'
}
}
tools {
maven 'apache-maven-latest'
jdk 'oracle-jdk8-latest'
}
options {
timestamps()
disableConcurrentBuilds()
}
stages {
stage('Clean') {
steps {
timeout(activity: true, time: 20) {
sh '''
git status --ignored
git clean -dfx
git reset --hard HEAD
git status --ignored
'''
}
}
}
stage('Gradle') {
steps {
timeout(activity: true, time: 20) {
sh "echo $JAVA_HOME"
sh "java -version"
sh "which java"
sh "./gradlew \
--no-daemon \
-PignoreTestFailures=true \
--refresh-dependencies \
--continue \
clean build signJar publish \
"
}
}
}
stage('Maven') {
steps {
timeout(activity: true, time: 20) {
sh "mvn \
-f releng/pom.xml \
-Dmaven.repo.local=.repository \
--batch-mode --update-snapshots \
clean install -Psign \
"
}
}
}
stage('japicmp') {
steps {
timeout(activity: true, time: 20) {
sh "./releng/runjapicmp.sh"
}
}
}
stage('Deploy Snapshot') {
steps {
timeout(activity: true, time: 20) {
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'
}
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
// Skip Deploy on release builds
// XXX: Can release vs snapshot be detected automatically so that
// the following line does not have to be commented/uncommented
// on each change to/from SNAPSHOT?
sh './releng/deploy-build.sh'
}
}
}
}
}
post {
always {
junit '**/build/test-results/test/*.xml'
archiveArtifacts 'build/**'
}
}
}