This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 324
/
Jenkinsfile
58 lines (55 loc) · 1.58 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
pipeline {
agent {
label "jenkins-maven-java11"
}
environment {
ORG = 'activiti'
APP_NAME = 'activiti-examples'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
}
stages {
stage('CI Build and push snapshot') {
when {
branch 'PR-*'
}
steps {
container('maven') {
sh "mvn clean verify"
}
}
}
stage('Build Release') {
when {
branch 'master'
}
steps {
container('maven') {
// ensure we're not on a detached head
sh "git checkout master"
sh "git config --global credential.helper store"
sh "jx step git credentials"
// so we can retrieve the version in later steps
sh "echo \$(jx-release-version) > VERSION"
sh "mvn versions:set -DnewVersion=\$(cat VERSION)"
sh 'mvn clean verify'
sh "git add --all"
sh "git commit -m \"Release \$(cat VERSION)\" --allow-empty"
sh "git tag -fa v\$(cat VERSION) -m \"Release version \$(cat VERSION)\""
sh "git push origin v\$(cat VERSION)"
}
}
}
}
post {
failure {
slackSend(
channel: "#activiti-community-builds",
color: "danger",
message: "activiti-examples branch=$BRANCH_NAME is failed http://jenkins.jx.35.240.9.95.nip.io/job/Activiti/job/activiti-examples/"
)
}
always {
cleanWs()
}
}
}