ci(azure-pipelines): fix and deduplicate condition when to setup images
This commit is contained in:
parent
17c7ed89c5
commit
c62c435638
@ -34,8 +34,7 @@ jobs:
|
|||||||
- job: SetupDependencies_${{parameters.serviceName}}
|
- job: SetupDependencies_${{parameters.serviceName}}
|
||||||
displayName: Install ${{parameters.serviceName}} dependencies
|
displayName: Install ${{parameters.serviceName}} dependencies
|
||||||
dependsOn: SetupImage_${{parameters.serviceName}}
|
dependsOn: SetupImage_${{parameters.serviceName}}
|
||||||
condition: always() # TODO: only succeeded and skipped
|
${{ if eq(variables.setupImages, true) }}:
|
||||||
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
|
|
||||||
condition: succeeded()
|
condition: succeeded()
|
||||||
${{ else }}:
|
${{ else }}:
|
||||||
condition: always()
|
condition: always()
|
||||||
|
|||||||
@ -11,7 +11,7 @@ parameters:
|
|||||||
jobs:
|
jobs:
|
||||||
- job: SetupImage_${{parameters.imageName}}
|
- job: SetupImage_${{parameters.imageName}}
|
||||||
displayName: Build ${{parameters.imageName}} image
|
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:
|
container:
|
||||||
image: devfra.azurecr.io/de.fraport.build/tools:1.1.0
|
image: devfra.azurecr.io/de.fraport.build/tools:1.1.0
|
||||||
endpoint: devfra
|
endpoint: devfra
|
||||||
|
|||||||
@ -53,8 +53,7 @@ parameters:
|
|||||||
|
|
||||||
variables:
|
variables:
|
||||||
buildImageUpstream: devfra.azurecr.io/de.fraport.fradrive.build
|
buildImageUpstream: devfra.azurecr.io/de.fraport.fradrive.build
|
||||||
onMasterBranch: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
|
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/') ) ]
|
||||||
onUpdateBranch: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/update')]
|
|
||||||
|
|
||||||
pool: 'Prod Private Agent Pool'
|
pool: 'Prod Private Agent Pool'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user