From 63ec898c4f5770f419c2f654e45136685e582f3b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Thu, 12 Mar 2020 16:45:50 +0100 Subject: [PATCH] Add environment variables required by release to buildInfo --- azure-pipelines.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 42de8d92d..de4aafc93 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -44,11 +44,27 @@ stages: - template: update-maven-version-steps.yml parameters: mavenSettingsFilePath: $(mavenSettings.secureFilePath) + - task: PythonScript@0 + name: fixBranchName + displayName: 'Compute short branch name for buildInfo' + inputs: + scriptSource: 'inline' + script: | + branch = "$(Build.SourceBranch)" + refPrefix = "refs/heads/" + if branch.startswith(refPrefix): + fixedBranch = branch[len(refPrefix):] + else: + fixedBranch = branch + # Workaround for https://github.com/Microsoft/azure-pipelines-agent/issues/838 + print("##vso[task.setvariable variable=fixedBranch;isOutput=true]" + fixedBranch) - task: Maven@3 displayName: 'Run Maven deploy' env: ARTIFACTORY_DEPLOY_USERNAME: $(ARTIFACTORY_DEPLOY_USERNAME) ARTIFACTORY_DEPLOY_PASSWORD: $(ARTIFACTORY_DEPLOY_PASSWORD) + GIT_SHA1: $(Build.SourceVersion) + GITHUB_BRANCH: $(fixBranchName.fixedBranch) inputs: goals: 'deploy' options: >-