From 6076ae2f9e902c08af9c7abc56cc64547312307a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 25 Jan 2021 20:51:01 +0100 Subject: [PATCH] ci: fix building for dependabot --- azure-pipelines.yml | 9 +++++---- outpost/azure-pipelines.yml | 9 +++++---- web/azure-pipelines.yml | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 30b60a95a..a46494d72 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,10 +8,10 @@ variables: POSTGRES_DB: authentik POSTGRES_USER: authentik POSTGRES_PASSWORD: "EK-5jnKfjrGRm<77" + ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: + branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], '/', '-') }} ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}: branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }} - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: - branchName: $(System.PullRequest.SourceBranch) stages: - stage: Lint @@ -374,11 +374,12 @@ stages: targetType: 'inline' script: | set -x - echo '##vso[task.setvariable variable=branchName]$(echo "$(System.PullRequest.SourceBranch)" | sed "s/\//-/g")' + branchName=$(echo "$(System.PullRequest.SourceBranch)" | sed "s/\//-/g")' + echo '##vso[task.setvariable variable=branchName]$branchName - task: Docker@2 inputs: containerRegistry: 'dockerhub' repository: 'beryju/authentik' command: 'buildAndPush' Dockerfile: 'Dockerfile' - tags: "gh-${{ variables.branchName }}" + tags: "gh-$(branchName)" diff --git a/outpost/azure-pipelines.yml b/outpost/azure-pipelines.yml index 6e6870fa4..4dab4aecb 100644 --- a/outpost/azure-pipelines.yml +++ b/outpost/azure-pipelines.yml @@ -2,10 +2,10 @@ trigger: - master variables: + ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: + branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], '/', '-') }} ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}: branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }} - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: - branchName: $(System.PullRequest.SourceBranch) stages: - stage: generate @@ -94,7 +94,8 @@ stages: targetType: 'inline' script: | set -x - echo '##vso[task.setvariable variable=branchName]$(echo "$(System.PullRequest.SourceBranch)" | sed "s/\//-/g")' + branchName=$(echo "$(System.PullRequest.SourceBranch)" | sed "s/\//-/g")' + echo '##vso[task.setvariable variable=branchName]$branchName - task: Docker@2 inputs: containerRegistry: 'dockerhub' @@ -102,4 +103,4 @@ stages: command: 'buildAndPush' Dockerfile: 'outpost/proxy.Dockerfile' buildContext: 'outpost/' - tags: "gh-${{ variables.branchName }}" + tags: "gh-$(branchName)" diff --git a/web/azure-pipelines.yml b/web/azure-pipelines.yml index b91173cad..0060e0e2e 100644 --- a/web/azure-pipelines.yml +++ b/web/azure-pipelines.yml @@ -2,10 +2,10 @@ trigger: - master variables: + ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: + branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], '/', '-') }} ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}: branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }} - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: - branchName: $(System.PullRequest.SourceBranch) stages: - stage: lint @@ -74,12 +74,13 @@ stages: targetType: 'inline' script: | set -x - echo '##vso[task.setvariable variable=branchName]$(echo "$(System.PullRequest.SourceBranch)" | sed "s/\//-/g")' + branchName=$(echo "$(System.PullRequest.SourceBranch)" | sed "s/\//-/g")' + echo '##vso[task.setvariable variable=branchName]$branchName - task: Docker@2 inputs: containerRegistry: 'dockerhub' repository: 'beryju/authentik-static' command: 'buildAndPush' Dockerfile: 'web/Dockerfile' - tags: "gh-${{ variables.branchName }}" + tags: "gh-$(branchName)" buildContext: 'web/'