-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile-Release-Prepare
29 lines (27 loc) · 1.15 KB
/
Jenkinsfile-Release-Prepare
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
node {
def mvnHome
stage('Preparation') {
deleteDir()
// Using scm configuration from upstream project.
checkout scm
//Setting GIT_BRANCH in environment because jenkins does not set it in the current version.
//env.GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
env.GIT_BRANCH = sh(returnStdout: true, script: 'git name-rev --name-only HEAD').trim()
println "BRANCH: $GIT_BRANCH"
// Get the Maven tool.
// ** NOTE: This 'maven-default' Maven tool must be configured
// ** in the global configuration.
mvnHome = tool 'maven-default'
}
stage('Build') {
println "BRANCH: $GIT_BRANCH"
// Run the maven build
sh "git config user.email '[email protected]'"
sh "git config user.name 'Jenkins'"
sh "'${mvnHome}/bin/mvn' -B clean release:prepare -PcreateRelease -Pwith-profile -Pwith-usermgt -Pwith-usermgt-mock -Darguments=-Dmaven.javadoc.skip=true -DpushChanges=true"
}
stage('Results') {
junit '**/target/surefire-reports/TEST-*.xml'
archive 'target/*.jar'dc
}
}