From 96ed8a9ecf96a6aec8cb35f2ad2263b8a54b131e Mon Sep 17 00:00:00 2001 From: Bert Hausmans Date: Wed, 14 Jan 2026 12:10:08 +0100 Subject: [PATCH] Configure ACR name: zdlas --- azure-pipelines.yml | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..19cfd04 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,59 @@ +# Azure DevOps Pipeline - Build and Push Docker Images +# Dit bestand kan gebruikt worden in Azure DevOps Pipelines + +trigger: + branches: + include: + - main + tags: + include: + - 'v*' + +pool: + vmImage: 'ubuntu-latest' + +variables: + # Azure Container Registry naam - pas aan naar jouw ACR + acrName: 'zdlas' + repositoryName: 'zuyderland-cmdb-gui' + dockerRegistryServiceConnection: 'zuyderland-cmdb-acr-connection' # Service connection naam in Azure DevOps + imageTag: '$(Build.BuildId)' + +stages: +- stage: Build + displayName: 'Build and Push Docker Images' + jobs: + - job: BuildImages + displayName: 'Build Docker Images' + steps: + - task: Docker@2 + displayName: 'Build and Push Backend Image' + inputs: + command: buildAndPush + repository: '$(repositoryName)/backend' + dockerfile: 'backend/Dockerfile.prod' + containerRegistry: '$(dockerRegistryServiceConnection)' + tags: | + $(imageTag) + latest + + - task: Docker@2 + displayName: 'Build and Push Frontend Image' + inputs: + command: buildAndPush + repository: '$(repositoryName)/frontend' + dockerfile: 'frontend/Dockerfile.prod' + containerRegistry: '$(dockerRegistryServiceConnection)' + tags: | + $(imageTag) + latest + + - task: PowerShell@2 + displayName: 'Output Image URLs' + inputs: + targetType: 'inline' + script: | + Write-Host "##vso[task.setvariable variable=backendImage]$(acrName).azurecr.io/$(repositoryName)/backend:$(imageTag)" + Write-Host "##vso[task.setvariable variable=frontendImage]$(acrName).azurecr.io/$(repositoryName)/frontend:$(imageTag)" + Write-Host "Backend Image: $(backendImage)" + Write-Host "Frontend Image: $(frontendImage)"