This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Jenkinsfile
98 lines (91 loc) · 5.09 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
pipeline {
agent {
kubernetes {
label 'centos7-6gb'
}
}
parameters {
choice choices: ['ci', 'integration', 'milestone', 'release'],
description: 'Sets the build type. CI builds are used for testing reasons only; integration builds are periodic builds; milestones are considered more-or-less stable, while releases are Eclipse.org releases with a corresponding release review.',
name: 'BUILD_TYPE'
string defaultValue: '',
description: 'If set, the tycho-versions plugin is used to update the versions of the Maven plugins before deployment for graduated plugins',
name: 'RELEASE_VERSION'
string defaultValue: '',
description: 'If set, the tycho-versions plugin is used to update the versions of the incubating Maven plugins before deployment for graduated plugins',
name: 'INCUBATION_VERSION'
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
timeout(120 /*minutes*/)
}
environment {
VERSION_MAVEN_PARAMETER = " ${params.RELEASE_VERSION ? '-Drepository.version=' + params.RELEASE_VERSION : ''} "
SIGN_BUILD_PARAMETER = " ${params.BUILD_TYPE == 'ci' ? '' : '-Dsign.build=true'} "
}
tools {
maven 'apache-maven-3.8.6'
jdk 'oracle-jdk8-latest' //AdoptOpenJDK does not work because of JavaFX dependencies
}
stages {
stage('Maven Bootstrap') {
steps {
sh "mvn -B -f releng/org.eclipse.viatra.parent.core/pom.xml ${SIGN_BUILD_PARAMETER} -Dmaven.repo.local=$WORKSPACE/.repository clean install"
}
}
stage('Full build') {
steps {
xvnc {
sh "mvn -B -f releng/org.eclipse.viatra.parent.all/pom.xml ${SIGN_BUILD_PARAMETER} ${VERSION_MAVEN_PARAMETER} -Dmaven.repo.local=$WORKSPACE/.repository -Dmaven.test.failure.ignore=true -DrunUITests=true clean install"
}
}
}
stage('download.eclipse.org') {
when {expression { return params.BUILD_TYPE != "ci" }}
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
export PROJECT=$WORKSPACE/releng/org.eclipse.viatra.update
export WORK_DIR=$PROJECT/work
export BUILD_DIR=/home/data/httpd/download.eclipse.org/viatra/updates/$BUILD_TYPE
export VERSION=$(<$PROJECT/target/classes/version)
mkdir $WORK_DIR
# Upload repository to download.eclipse.org
ssh -o BatchMode=yes genie.viatra@projects-storage.eclipse.org mkdir $BUILD_DIR/$VERSION
scp -o BatchMode=yes -r $PROJECT/target/repository/* genie.viatra@projects-storage.eclipse.org:$BUILD_DIR/$VERSION
# Upload latest repository
scp -o BatchMode=yes -r $PROJECT/target/classes/latest genie.viatra@projects-storage.eclipse.org:$BUILD_DIR
'''
}
}
}
stage('Maven Deploy') {
when {branch "master"}
steps {
script {
if (params.RELEASE_VERSION) {
sh "mvn -B -f releng/org.eclipse.viatra.parent.all/pom.xml -Dmaven.repo.local=$WORKSPACE/.repository -DnewVersion=$RELEASE_VERSION org.eclipse.tycho:tycho-versions-plugin:set-version"
sh "mvn -B -f releng/org.eclipse.viatra.parent.core/pom.xml ${SIGN_BUILD_PARAMETER} -Dmaven.repo.local=$WORKSPACE/.repository clean install"
}
if (params.INCUBATION_VERSION) {
sh "mvn -B -f releng/org.eclipse.viatra.parent.incubation.maven/pom.xml -Dmaven.repo.local=$WORKSPACE/.repository -DnewVersion=$INCUBATION_VERSION org.eclipse.tycho:tycho-versions-plugin:set-version"
sh "mvn -B -f releng/org.eclipse.viatra.parent.incubation.maven/pom.xml ${SIGN_BUILD_PARAMETER} -Dmaven.repo.local=$WORKSPACE/.repository clean install"
}
}
sh "mvn -B -f releng/org.eclipse.viatra.parent.core/pom.xml ${SIGN_BUILD_PARAMETER} -Dmaven.repo.local=$WORKSPACE/.repository deploy --fail-never"
sh "mvn -B -f releng/org.eclipse.viatra.parent.incubation.maven/pom.xml ${SIGN_BUILD_PARAMETER} -Dmaven.repo.local=$WORKSPACE/.repository deploy --fail-never"
}
}
}
post {
always {
archiveArtifacts artifacts: 'releng/org.eclipse.viatra.update/target/repository/**'
archiveArtifacts artifacts: 'releng/org.eclipse.viatra.update/target/org.eclipse.viatra.update-*.zip'
archiveArtifacts artifacts: 'query/tests/org.eclipse.viatra.query.rcptt/org.eclipse.viatra.query.rcptt.tests/target/results/**'
archiveArtifacts artifacts: 'releng/org.eclipse.viatra.docs/target/reference/api/**'
archiveArtifacts artifacts: 'query/tests/org.eclipse.viatra.query.runtime.cps.tests/BasicCpsTest_coverage.html'
javadoc javadocDir: 'releng/org.eclipse.viatra.docs/target/reference/api', keepAll: false
junit testResults: '**/tests/**/target/surefire-reports/*.xml'
}
}
}