ci: fix building for dependabot

This commit is contained in:
Jens Langhammer 2021-01-25 20:51:01 +01:00
parent 78b4b61882
commit 6076ae2f9e
3 changed files with 15 additions and 12 deletions

View File

@ -8,10 +8,10 @@ variables:
POSTGRES_DB: authentik POSTGRES_DB: authentik
POSTGRES_USER: authentik POSTGRES_USER: authentik
POSTGRES_PASSWORD: "EK-5jnKfjrGRm<77" 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/') }}: ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }} branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }}
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: $(System.PullRequest.SourceBranch)
stages: stages:
- stage: Lint - stage: Lint
@ -374,11 +374,12 @@ stages:
targetType: 'inline' targetType: 'inline'
script: | script: |
set -x 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 - task: Docker@2
inputs: inputs:
containerRegistry: 'dockerhub' containerRegistry: 'dockerhub'
repository: 'beryju/authentik' repository: 'beryju/authentik'
command: 'buildAndPush' command: 'buildAndPush'
Dockerfile: 'Dockerfile' Dockerfile: 'Dockerfile'
tags: "gh-${{ variables.branchName }}" tags: "gh-$(branchName)"

View File

@ -2,10 +2,10 @@ trigger:
- master - master
variables: variables:
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], '/', '-') }}
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}: ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }} branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }}
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: $(System.PullRequest.SourceBranch)
stages: stages:
- stage: generate - stage: generate
@ -94,7 +94,8 @@ stages:
targetType: 'inline' targetType: 'inline'
script: | script: |
set -x 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 - task: Docker@2
inputs: inputs:
containerRegistry: 'dockerhub' containerRegistry: 'dockerhub'
@ -102,4 +103,4 @@ stages:
command: 'buildAndPush' command: 'buildAndPush'
Dockerfile: 'outpost/proxy.Dockerfile' Dockerfile: 'outpost/proxy.Dockerfile'
buildContext: 'outpost/' buildContext: 'outpost/'
tags: "gh-${{ variables.branchName }}" tags: "gh-$(branchName)"

View File

@ -2,10 +2,10 @@ trigger:
- master - master
variables: variables:
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], '/', '-') }}
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}: ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }} branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }}
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: $(System.PullRequest.SourceBranch)
stages: stages:
- stage: lint - stage: lint
@ -74,12 +74,13 @@ stages:
targetType: 'inline' targetType: 'inline'
script: | script: |
set -x 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 - task: Docker@2
inputs: inputs:
containerRegistry: 'dockerhub' containerRegistry: 'dockerhub'
repository: 'beryju/authentik-static' repository: 'beryju/authentik-static'
command: 'buildAndPush' command: 'buildAndPush'
Dockerfile: 'web/Dockerfile' Dockerfile: 'web/Dockerfile'
tags: "gh-${{ variables.branchName }}" tags: "gh-$(branchName)"
buildContext: 'web/' buildContext: 'web/'