From 3b12de23ff32fcc7638cb995e8c62873bfab7199 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 2 Dec 2020 22:41:53 +0100 Subject: [PATCH] ci: fix mismatched docker tags being used --- proxy/azure-pipelines.yml | 8 +++++++- web/azure-pipelines.yml | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/proxy/azure-pipelines.yml b/proxy/azure-pipelines.yml index 0144f6dd5..8dc3c63a9 100644 --- a/proxy/azure-pipelines.yml +++ b/proxy/azure-pipelines.yml @@ -1,6 +1,12 @@ trigger: - 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: - stage: generate jobs: @@ -87,4 +93,4 @@ stages: command: 'buildAndPush' Dockerfile: 'proxy/Dockerfile' buildContext: 'proxy/' - tags: 'gh-$(Build.SourceBranchName)' + tags: "gh-${{ variables.branchName }}" diff --git a/web/azure-pipelines.yml b/web/azure-pipelines.yml index 83ed61fec..d2e61c6cf 100644 --- a/web/azure-pipelines.yml +++ b/web/azure-pipelines.yml @@ -1,6 +1,12 @@ trigger: - 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: - stage: lint jobs: