Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

Commit

Permalink
add release stage (via #957)
Browse files Browse the repository at this point in the history
  • Loading branch information
eroshenkoam authored May 29, 2017
1 parent 8457c38 commit 081de39
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
pipeline {
agent { label 'java' }
parameters {
booleanParam(name: 'RELEASE', defaultValue: false, description: 'Perform release?')
string(name: 'RELEASE_VERSION', defaultValue: '', description: 'Release version')
string(name: 'NEXT_VERSION', defaultValue: '', description: 'Next version (without SNAPSHOT)')
}
stages {
stage('Build') {
steps {
Expand All @@ -13,6 +18,19 @@ pipeline {
alwaysLinkToLastBuild: false, keepAll: false])
}
}
stage('Release') {
when { expression { return params.RELEASE } }
steps {
configFileProvider([configFile(fileId: 'sonatype-settings.xml', variable: 'SETTINGS')]) {
sshagent(['qameta-ci_ssh']) {
sh 'git checkout master && git pull origin master'
sh "./mvnw release:prepare release:perform -B -s ${env.SETTINGS} " +
"-DreleaseVersion=${params.RELEASE_VERSION} " +
"-DdevelopmentVersion=${params.NEXT_VERSION}-SNAPSHOT"
}
}
}
}
}
post {
always {
Expand Down
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagNameFormat>@{project.version}</tagNameFormat>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 081de39

Please sign in to comment.