-
Notifications
You must be signed in to change notification settings - Fork 9
/
Jenkinsfile
157 lines (131 loc) · 5.51 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
154
155
156
157
pipeline {
agent {
label 'migration'
}
tools {
maven 'apache-maven-latest'
jdk 'openjdk-jdk17-latest'
}
environment {
BUILD_KEY = (github.isPullRequest() ? CHANGE_TARGET : BRANCH_NAME).replaceFirst(/^v/, '')
CAPELLA_PRODUCT_PATH = "${WORKSPACE}/capella/capella"
CAPELLA_BRANCH = 'master'
}
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
}
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.diffmerge.defer.releng.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.diffmerge.defer.releng.site/target/*-dropins-*.zip", deploymentDirName)
deployer.addonNightlyUpdateSite("${WORKSPACE}/releng/org.polarsys.capella.diffmerge.defer.releng.site/target/*-updateSite-*.zip", deploymentDirName)
currentBuild.description = "${deploymentDirName} - <a href=\"https://download.eclipse.org/capella/addons/deferredmerge/dropins/nightly/${deploymentDirName}\">drop-in</a> - <a href=\"https://download.eclipse.org/capella/addons/deferredmerge/updates/nightly/${deploymentDirName}\">update-site</a>"
}
}
}
stage('Download Capella') {
steps {
script {
def capellaURL = capella.getDownloadURL("master", 'linux', '')
sh "curl -k -o capella.tar.gz ${capellaURL}"
sh "tar xzf capella.tar.gz"
}
}
}
stage('Install test features') {
steps {
script {
sh "chmod 755 ${CAPELLA_PRODUCT_PATH}"
sh "chmod 755 ${WORKSPACE}/capella/jre/bin/java"
eclipse.installFeature("${CAPELLA_PRODUCT_PATH}", capella.getTestUpdateSiteURL("master"), 'org.polarsys.capella.test.feature.feature.group')
eclipse.installFeature("${CAPELLA_PRODUCT_PATH}", "file:/${WORKSPACE}/releng/org.polarsys.capella.diffmerge.defer.releng.site/target/repository/".replace("\\", "/"), 'org.polarsys.capella.diffmerge.defer.feature.feature.group')
eclipse.installFeature("${CAPELLA_PRODUCT_PATH}", "file:/${WORKSPACE}/releng/org.polarsys.capella.diffmerge.defer.releng.site/target/repository/".replace("\\", "/"), 'org.polarsys.capella.diffmerge.defer.tests.feature.feature.group')
}
}
}
stage('Run tests') {
steps {
script {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
tester.runUITests("${CAPELLA_PRODUCT_PATH}", 'DiffMergeDeferTestSuite', 'org.polarsys.capella.diffmerge.defer.tests.ju',
['org.polarsys.capella.diffmerge.defer.tests.ju.testsuites.DiffMergeDeferTestSuite'])
}
}
}
}
stage('Run RCPTT') {
steps {
script {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
tester.runRcptt("-Prcptt")
}
}
}
}
stage('Sonar') {
steps {
script {
tester.publishTests()
sonar.runSonar("eclipse-capella_capella-deferred-merge", "eclipse/capella-deferred-merge", 'sonarcloud-token-deferred-merge')
}
}
}
}
post {
always {
archiveArtifacts artifacts: '**/*.log, *.log, *.exec'
}
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()
}
}
}
}
}