-
Notifications
You must be signed in to change notification settings - Fork 10
/
Jenkinsfile
136 lines (124 loc) · 4.78 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
def overridesUrl = 'https://github.com/adoptium/jmc-build.git'
def overridesBranch = 'master'
def jmcBranch = 'master'
def jmcVersion = '9.0.0-SNAPSHOT'
pipeline {
agent {
kubernetes {
inheritFrom 'centos-8'
}
}
tools {
maven 'apache-maven-3.8.6'
jdk 'temurin-jdk17-latest'
}
options {
timestamps()
disableConcurrentBuilds()
pipelineTriggers([cron('H 20 * * *')])
}
environment {
MAVEN_OPTS = '-Xmx2048m -Declipse.p2.mirrors=false'
}
stages {
stage('Preparation') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: jmcBranch]],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://github.com/openjdk/jmc.git']]
])
dir('workspace') {
git branch: overridesBranch, url: overridesUrl
}
// apply overrides
sh 'cp workspace/overrides/* . -rvf'
sh 'mkdir .m2 && cp workspace/.github/workflows/settings.xml .m2/'
}
}
stage('Build & test core libraries') {
steps {
dir('core') {
// Run the maven build
sh 'mvn install'
}
}
}
stage('Build & test agent') {
steps {
dir('agent') {
// Run the maven build
sh 'mvn install'
}
}
}
stage('Build') {
steps {
// Run the maven build
dir('releng/third-party') {
sh 'mvn clean'
sh 'mvn p2:site'
sh 'mvn jetty:run &'
}
sh 'mvn package'
}
}
stage('Tests') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
timeout(180) {
xvnc {
sh 'mvn verify -fae -P uitests'
}
}
}
}
}
}
post {
always {
junit '**/target/surefire-reports/TEST-*.xml'
dir('target/products') {
sh "mv -f org.openjdk.jmc-linux.gtk.aarch64.tar.gz org.openjdk.jmc-${jmcVersion}-linux.gtk.aarch64.tar.gz"
sh "mv -f org.openjdk.jmc-linux.gtk.x86_64.tar.gz org.openjdk.jmc-${jmcVersion}-linux.gtk.x86_64.tar.gz"
sh "mv -f org.openjdk.jmc-macosx.cocoa.aarch64.tar.gz org.openjdk.jmc-${jmcVersion}-macosx.cocoa.aarch64.tar.gz"
sh "mv -f org.openjdk.jmc-macosx.cocoa.x86_64.tar.gz org.openjdk.jmc-${jmcVersion}-macosx.cocoa.x86_64.tar.gz"
sh "mv -f org.openjdk.jmc-win32.win32.x86_64.zip org.openjdk.jmc-${jmcVersion}-win32.win32.x86_64.zip"
}
archiveArtifacts artifacts: 'agent/target/agent-*', fingerprint: true
archiveArtifacts artifacts: 'application/org.openjdk.jmc.updatesite.ide/target/*.zip', fingerprint: true
archiveArtifacts artifacts: 'target/products/org.openjdk.jmc-*', fingerprint: true
}
// send a mail on unsuccessful and fixed builds
unsuccessful { // means unstable || failure || aborted
// Email notification
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [culprits(), requestor()]
//to: '[email protected]'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/surefire-reports/TEST-*.xml', followSymlinks: false
// Slack notification
slackSend(
channel: '#build-failures',
color: 'danger',
message: "Build *FAILED* for `${env.JOB_NAME}` - Build #${env.BUILD_NUMBER}\nSee details: ${env.BUILD_URL}"
)
}
fixed { // back to normal
// Email notification
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [culprits(), requestor()]
//to: '[email protected]'
// Slack notification
slackSend(
channel: '#build-failures',
color: 'good',
message: "Build *FIXED* for `${env.JOB_NAME}` - Build #${env.BUILD_NUMBER}\nSee details: ${env.BUILD_URL}"
)
}
}
}