forked from viatra/v4md
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
67 lines (64 loc) · 2.17 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
// Tell Jenkins how to build projects from this repository
pipeline {
agent {
label 'magicdraw19'
}
parameters {
string(name: 'RELEASE_VERSION', defaultValue: '',
description: 'Set this parameter to the VIATRA version this V4MD build should include (e.g. 2.0.0.M3) and set the project version version accordingly. Leave it empty to skip this step.')
string(name: 'INCUBATION_VERSION', defaultValue: '',
description: 'Set this parameter to the corresponding incubation version of the related VIATRA release.')
string(name: 'PLUGIN_VERSION', defaultValue: '',
description: 'Set this parameter to the desired V4MD version.')
string(name: 'BUILD_NUMBER', defaultValue: '',
description: 'Set this parameter to the desired MD internal version.')
}
// Keep only the last 5 builds
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
}
environment {
VERSION_STRINGS = "${params.PLUGIN_VERSION ? '-Pversion=' + params.PLUGIN_VERSION : ''} ${params.RELEASE_VERSION ? '-PviatraVersion=' + params.RELEASE_VERSION : ''} ${params.INCUBATION_VERSION ? '-PviatraIncubationVersion=' + params.INCUBATION_VERSION : ''} ${params.BUILD_NUMBER ? '-PbuildNumber=' + params.BUILD_NUMBER : ''}"
}
tools {
maven 'Maven 3.3.9'
jdk 'Oracle JDK 8'
}
stages {
stage('Build Plug-in') {
steps {
dir ('com.incquerylabs.v4md'){
sh "./gradlew clean"
sh "./gradlew ${VERSION_STRINGS} assemble"
}
}
}
stage('Running Plug-in Tests') {
steps {
dir ('com.incquerylabs.v4md'){
wrap([$class: 'Xvnc']) {
sh "./gradlew ${VERSION_STRINGS} runTest"
}
}
}
}
stage('Deploy Plugin') {
when {branch "master"}
steps {
withCredentials([usernamePassword(credentialsId: 'nexus-buildserver-deploy', passwordVariable: 'DEPLOY_PASSWORD', usernameVariable: 'DEPLOY_USER')]) {
script{
dir ('com.incquerylabs.v4md') {
sh "./gradlew ${VERSION_STRINGS} publish"
}
}
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'com.incquerylabs.v4md/build/distributions/*.zip', onlyIfSuccessful: true
junit testResults: 'com.incquerylabs.v4md/build/install/target/*.xml'
}
}
}