From db868cc228f1d52178b67337ba2e3b4313a1c011 Mon Sep 17 00:00:00 2001 From: "AO Industries, Inc" Date: Sun, 17 Sep 2023 04:49:38 +0000 Subject: [PATCH] New ${devMode} property that will be true only when the "development" profile is active. "publish" profile may not be activated at the same time as "development" profile. --- Jenkinsfile | 11 ++++++++++- book/Jenkinsfile | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e4e1732..732824f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -969,7 +969,16 @@ void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk1 mavenLocalRepo: ".m2/repository-jdk-$deployJdk", jdk: "jdk-$deployJdk" ) { - sh "${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy,publish deploy" + // "publish" profile may not be enabled at the same time as "development" profile, + // disable for any project that always has "development" profile enabled. + sh """#!/bin/bash +if [ -f profile.d/development ] +then + ${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy deploy +else + ${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy,publish deploy +fi +""" } // Restore surefire-reports sh restoreSurefireReportsScript() diff --git a/book/Jenkinsfile b/book/Jenkinsfile index 3314226..01c21e1 100644 --- a/book/Jenkinsfile +++ b/book/Jenkinsfile @@ -967,7 +967,16 @@ void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk1 mavenLocalRepo: ".m2/repository-jdk-$deployJdk", jdk: "jdk-$deployJdk" ) { - sh "${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy,publish deploy" + // "publish" profile may not be enabled at the same time as "development" profile, + // disable for any project that always has "development" profile enabled. + sh """#!/bin/bash +if [ -f profile.d/development ] +then + ${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy deploy +else + ${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy,publish deploy +fi +""" } // Restore surefire-reports sh restoreSurefireReportsScript()