Skip to content

Commit

Permalink
add release stage to pipeline (via allure-framework#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
eroshenkoam authored May 24, 2017
1 parent 77c9959 commit d450d9d
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
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") {
stage('Build') {
steps {
sh './gradlew build'
}
}
stage("Reports") {
stage('Reports') {
steps {
checkstyle pattern: '**/build/reports/checkstyle/main.xml', defaultEncoding: 'UTF8',
canComputeNew: false, healthy: '', unHealthy: ''
Expand All @@ -16,7 +21,7 @@ pipeline {
canComputeNew: false, healthy: '', unHealthy: ''
}
}
stage("Demo") {
stage('Demo') {
steps {
sh 'allure-commandline/build/install/allure/bin/allure generate ' +
'allure-generator/test-data/demo --clean -o build/report-demo'
Expand All @@ -29,8 +34,25 @@ pipeline {
reportTitles: '', allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false])
}
}
stage('Release') {
when { expression { return params.RELEASE } }
steps {
withCredentials([usernamePassword(credentialsId: 'qameta-ci_bintray',
usernameVariable: 'BINTRAY_USER', passwordVariable: 'BINTRAY_API_KEY')]) {
sshagent(['qameta-ci_ssh']) {
sh 'git checkout master && git pull origin master'
sh "./gradlew release -Prelease.useAutomaticVersion=true " +
"-Prelease.releaseVersion=${RELEASE_VERSION} " +
"-Prelease.newVersion=${NEXT_VERSION}-SNAPSHOT"
}
}
}
}
}
post {
always {
deleteDir()
}
failure {
slackSend message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} failed (<${env.BUILD_URL}|Open>)",
color: 'danger', teamDomain: 'qameta', channel: 'allure', tokenCredentialId: 'allure-channel'
Expand Down

0 comments on commit d450d9d

Please sign in to comment.