You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2021/06/06 19:43:34 UTC
[logging-pipelines] branch master updated: Disable deploy step for
releases
This is an automated email from the ASF dual-hosted git repository.
mattsicker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-pipelines.git
The following commit(s) were added to refs/heads/master by this push:
new 61382c8 Disable deploy step for releases
61382c8 is described below
commit 61382c83f01f95534def9ddfcd6be5e3b996dccb
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Sun Jun 6 14:41:54 2021 -0500
Disable deploy step for releases
Whenever the version is set to a release version (like during a
release), the deploy step on the master branch will fail as the version
is not a snapshot (and is attempting to deploy to the snapshots
repository). This refactors some tool usage and checks the maven project
version to prevent this error.
---
chainsaw/Jenkinsfile | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/chainsaw/Jenkinsfile b/chainsaw/Jenkinsfile
index c66846d..1645483 100644
--- a/chainsaw/Jenkinsfile
+++ b/chainsaw/Jenkinsfile
@@ -30,12 +30,21 @@ pipeline {
libraries {
lib 'logging'
}
+ tools {
+ jdk 'jdk_8_latest'
+ maven 'maven_3_latest'
+ }
+ environment {
+ PROJECT_VERSION = "${sh(returnStdout: true, script: 'mvn help:evaluate -Dexpression=project.version -q -DforceStdout')}"
+ }
stages {
stage('Build') {
steps {
cancelPreviousRunningBuilds()
- mvn '-Pdevelopment site:site'
- mvn '-Pdevelopment install'
+ sh '''
+ mvn -Pdevelopment site:site
+ mvn -Pdevelopment install
+ '''
}
post {
always {
@@ -45,10 +54,13 @@ pipeline {
}
stage('Deploy') {
when {
- branch 'master'
+ allOf {
+ branch 'master'
+ expression { env.PROJECT_VERSION.endsWith('-SNAPSHOT') }
+ }
}
steps {
- mvn '-Pdevelopment -DskipTests deploy'
+ sh 'mvn -Pdevelopment -DskipTests deploy'
}
post {
fixed {