-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
153 lines (125 loc) · 4.21 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
pipeline {
agent {
label 'migration'
}
tools {
maven 'apache-maven-latest'
jdk 'oracle-jdk8-latest'
}
environment {
BUILD_KEY = (github.isPullRequest() ? CHANGE_TARGET : BRANCH_NAME).replaceFirst(/^v/, '')
CAPELLA_PRODUCT_PATH = "${WORKSPACE}/capella/capella"
}
stages {
stage('Generate Target Platform') {
steps {
script {
if(github.isPullRequest()){
github.buildStartedComment()
}
currentBuild.description = BUILD_KEY
sh 'env'
sh 'mvn clean verify -f releng/org.polarsys.capella.scenario.editor.target/pom.xml'
}
}
}
stage('Build and Package') {
steps {
script {
def customParams = github.isPullRequest() ? '-DSKIP_SONAR=true' : '-Psign'
sh "mvn -Djacoco.skip=true -DjavaDocPhase=none ${customParams} clean package -f pom.xml"
}
}
}
stage('Deploy to Nightly') {
steps {
script {
def deploymentDirName =
(github.isPullRequest() ? "${BUILD_KEY}-${BRANCH_NAME}-${BUILD_ID}" : "${BRANCH_NAME}-${BUILD_ID}")
.replaceAll('/','-')
deployer.addonNightlyDropins("${WORKSPACE}/releng/org.polarsys.capella.scenario.editor.site/target/*-dropins-*.zip", deploymentDirName)
deployer.addonNightlyUpdateSite("${WORKSPACE}/releng/org.polarsys.capella.scenario.editor.site/target/*-updateSite-*.zip", deploymentDirName)
}
}
}
stage('Download Capella') {
when {
expression {
github.isPullRequest()
}
}
steps {
script {
def capellaURL = capella.getDownloadURL("${BUILD_KEY}", 'linux', '')
sh "curl -k -o capella.zip ${capellaURL}"
sh "unzip -q capella.zip"
}
}
}
stage('Install test features') {
when {
expression {
github.isPullRequest()
}
}
steps {
script {
sh "chmod 755 ${CAPELLA_PRODUCT_PATH}"
eclipse.installFeature("${CAPELLA_PRODUCT_PATH}", 'http://download.eclipse.org/tools/orbit/downloads/drops/R20130827064939/repository', 'org.jsoup')
eclipse.installFeature("${CAPELLA_PRODUCT_PATH}", capella.getTestUpdateSiteURL("${BUILD_KEY}"), 'org.polarsys.capella.test.feature.feature.group')
eclipse.installFeature("${CAPELLA_PRODUCT_PATH}", "file:/${WORKSPACE}/releng/org.polarsys.capella.scenario.editor.site/target/repository/".replace("\\", "/"), 'org.polarsys.capella.scenario.editor.feature.feature.group')
eclipse.installFeature("${CAPELLA_PRODUCT_PATH}", "file:/${WORKSPACE}/releng/org.polarsys.capella.scenario.editor.site/target/repository/".replace("\\", "/"), 'org.polarsys.capella.scenario.editor.tests.feature.feature.group')
}
}
}
stage('Run tests') {
when {
expression {
github.isPullRequest()
}
}
steps {
script {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
tester.runUITests("${CAPELLA_PRODUCT_PATH}", 'ScenarioEditorTestSuite', 'org.polarsys.capella.scenario.editor.ju',
['org.polarsys.capella.scenario.editor.ju.testsuites.ScenarioEditorTestSuite'])
}
junit '*.xml'
}
}
}
}
post {
always {
archiveArtifacts artifacts: '**/*.log, *.log, *.xml, **/*.layout'
}
success {
script {
if(github.isPullRequest()){
github.buildSuccessfullComment()
}
}
}
unstable {
script {
if(github.isPullRequest()){
github.buildUnstableComment()
}
}
}
failure {
script {
if(github.isPullRequest()){
github.buildFailedComment()
}
}
}
aborted {
script {
if(github.isPullRequest()){
github.buildAbortedComment()
}
}
}
}
}