ci: fix mismatched docker tags being used

This commit is contained in:
Jens Langhammer 2020-12-02 22:41:53 +01:00
parent 12f788661c
commit 3b12de23ff
2 changed files with 13 additions and 1 deletions

View File

@ -1,6 +1,12 @@
trigger: trigger:
- master - master
variables:
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }}
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], 'refs/heads/', '') }}
stages: stages:
- stage: generate - stage: generate
jobs: jobs:
@ -87,4 +93,4 @@ stages:
command: 'buildAndPush' command: 'buildAndPush'
Dockerfile: 'proxy/Dockerfile' Dockerfile: 'proxy/Dockerfile'
buildContext: 'proxy/' buildContext: 'proxy/'
tags: 'gh-$(Build.SourceBranchName)' tags: "gh-${{ variables.branchName }}"

View File

@ -1,6 +1,12 @@
trigger: trigger:
- master - master
variables:
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }}
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], 'refs/heads/', '') }}
stages: stages:
- stage: lint - stage: lint
jobs: jobs: