ci(azure-pipelines): only rebuild frontend image on master or update/... branches

This commit is contained in:
Sarah Vaupel 2025-01-21 14:46:01 +01:00
parent 1cc140a1cc
commit 492a758723

View File

@ -7,9 +7,11 @@ pool: 'Prod Private Agent Pool'
variables:
imageFradriveUpstream: devfra.azurecr.io/de.fraport.fradrive.build
onMasterBranch: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
onUpdateBranch: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/update')]
jobs:
- job: FrontendImage
condition: or(eq(variables.onMasterBranch, true), eq(variables.onUpdateBranch, true))
container:
image: devfra.azurecr.io/de.fraport.build/tools:1.1.0
endpoint: devfra
@ -48,7 +50,7 @@ jobs:
docker push ${{variables.imageFradriveUpstream}}/frontend:$(Build.BuildNumber)
- task: Bash@3
displayName: Update latest frontend image
# condition: eq(variables.onMasterBranch, true)
condition: eq(variables.onMasterBranch, true)
inputs:
targetType: inline
script: |
@ -88,8 +90,8 @@ jobs:
containerRegistry: devFra
- job: FrontendBuild
dependsOn: FrontendImage
condition: succeeded()
# dependsOn: FrontendImage
# condition: succeeded()
container:
# image: devfra.azurecr.io/de.fraport.fradrive.build/frontend:$(Build.BuildNumber)
image: devfra.azurecr.io/de.fraport.fradrive.build/frontend:latest