Skip to content

Commit 63ec898

Browse files
committed
Add environment variables required by release to buildInfo
1 parent 3102096 commit 63ec898

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

azure-pipelines.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,27 @@ stages:
4444
- template: update-maven-version-steps.yml
4545
parameters:
4646
mavenSettingsFilePath: $(mavenSettings.secureFilePath)
47+
- task: PythonScript@0
48+
name: fixBranchName
49+
displayName: 'Compute short branch name for buildInfo'
50+
inputs:
51+
scriptSource: 'inline'
52+
script: |
53+
branch = "$(Build.SourceBranch)"
54+
refPrefix = "refs/heads/"
55+
if branch.startswith(refPrefix):
56+
fixedBranch = branch[len(refPrefix):]
57+
else:
58+
fixedBranch = branch
59+
# Workaround for https://github.com/Microsoft/azure-pipelines-agent/issues/838
60+
print("##vso[task.setvariable variable=fixedBranch;isOutput=true]" + fixedBranch)
4761
- task: Maven@3
4862
displayName: 'Run Maven deploy'
4963
env:
5064
ARTIFACTORY_DEPLOY_USERNAME: $(ARTIFACTORY_DEPLOY_USERNAME)
5165
ARTIFACTORY_DEPLOY_PASSWORD: $(ARTIFACTORY_DEPLOY_PASSWORD)
66+
GIT_SHA1: $(Build.SourceVersion)
67+
GITHUB_BRANCH: $(fixBranchName.fixedBranch)
5268
inputs:
5369
goals: 'deploy'
5470
options: >-

0 commit comments

Comments
 (0)