ci(azure-pipelines): fix and deduplicate condition when to setup images

This commit is contained in:
Sarah Vaupel 2025-02-06 18:57:12 +01:00
parent 17c7ed89c5
commit c62c435638
3 changed files with 3 additions and 5 deletions

View File

@ -34,8 +34,7 @@ jobs:
- job: SetupDependencies_${{parameters.serviceName}}
displayName: Install ${{parameters.serviceName}} dependencies
dependsOn: SetupImage_${{parameters.serviceName}}
condition: always() # TODO: only succeeded and skipped
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
${{ if eq(variables.setupImages, true) }}:
condition: succeeded()
${{ else }}:
condition: always()

View File

@ -11,7 +11,7 @@ parameters:
jobs:
- job: SetupImage_${{parameters.imageName}}
displayName: Build ${{parameters.imageName}} image
condition: or(eq(variables.forcePushLatest, true), eq(variables.onMasterBranch, true), eq(variables.onUpdateBranch, true))
condition: eq(variables.setupImages, true)
container:
image: devfra.azurecr.io/de.fraport.build/tools:1.1.0
endpoint: devfra

View File

@ -53,8 +53,7 @@ parameters:
variables:
buildImageUpstream: devfra.azurecr.io/de.fraport.fradrive.build
onMasterBranch: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
onUpdateBranch: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/update')]
setupImages: $[ or( eq(variables.forcePushLatest, true), eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/update'), startsWith(variables['Build.SourceBranch'], 'refs/tags/') ) ]
pool: 'Prod Private Agent Pool'