-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathJenkinsfile_release
More file actions
32 lines (30 loc) · 1.06 KB
/
Jenkinsfile_release
File metadata and controls
32 lines (30 loc) · 1.06 KB
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
pipeline {
agent any // configure here if you need any agent
options {
buildDiscarder(logRotator(numToKeepStr: '10')) // configurable
timeout(time: 30, unit: 'MINUTES') // configurable
}
parameters {
string(name: 'Branch', defaultValue: 'master', description: 'Git Branch to release')
string(name: 'Version', defaultValue: null, description: 'Version (1.0.0, 2.0.0-beta-1) ')
}
stages{
stage("Checkout branch ") {
steps{
git url:"https://github.com/cloudbeers/my-webapp.git", branch:"$Branch"
}
}
stage("Release of this great product xxx"){
steps{
echo "The release $Version"
withEnv(['GIT_COMMITTER_NAME=John Doe', 'GIT_COMMITTER_EMAIL=john@beers.com',
'GIT_AUTHOR_NAME=John Doe', 'GIT_AUTHOR_EMAIL=john@beers.com']) {
withMaven(){
sh "./mvnw clean release:prepare release:perform -DreleaseVersion=$Version" // for temporary nodes
// if Version is empty maven calculate version number using default strategy
}
}
}
}
}
}