diff --git a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy index 1e40e315..03870241 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy @@ -19,13 +19,14 @@ class SemanticReleasingExecutor { this.config = 'com/freeleaps/devops/builtins/semantic-release/releaserc.json' } - def release(credentialsId) { + def release(credentialsId, branch) { steps.log.warn("SemanticReleasingExecutor", "Configuration file customization is not supported yet, using builtin release rules as fallback") steps.log.info("SemanticReleasingExecutor", "Releasing with config: ${config}") steps.dir(steps.env.workroot) { steps.withCredentials([steps.usernamePassword(credentialsId: credentialsId, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { steps.env.GIT_CREDENTIALS = "${steps.env.GIT_USERNAME}:${steps.env.GIT_PASSWORD}"- + steps.env.GIT_BRANCH = branch steps.log.info("SemanticReleasingExecutor", "Installing semantic-release requirements...") steps.sh "apt-get -y update && apt-get install -y --no-install-recommends git apt-transport-https ca-certificates curl wget gnupg" steps.writeFile file: '.releaserc.json', text: steps.libraryResource(config) diff --git a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy index 066c61de..f610f386 100644 --- a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy +++ b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy @@ -273,7 +273,7 @@ def generateComponentStages(component, configurations) { sourceFetcher.fetch(configurations) def semanticReleasingExecutor = new SemanticReleasingExecutor(this, env.workroot) - semanticReleasingExecutor.release(configurations.serviceGitCredentialsId) + semanticReleasingExecutor.release(configurations.serviceGitCredentialsId, configurations.serviceGitBranch) } } }