Skip to content

Commit

Permalink
Dasd 8439 add windows support to docker build (#220)
Browse files Browse the repository at this point in the history
* Refactored dockerfile-build params and added Platform param

* Fixed values property for Platform param
  • Loading branch information
NickGraham101 authored Oct 21, 2021
1 parent 91011ec commit 83ebd5f
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions azure-pipelines-templates/build/step/dockerfile-build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
parameters:
ContainerRegistryName:
ImageName:
ServiceConnection:
AdditionalArgs: ''
BranchToCreateLatestTag: main
WorkingDirectory: $(Build.SourcesDirectory)
- name: ContainerRegistryName
- name: ImageName
- name: ServiceConnection
- name: AdditionalArgs
default: ''
- name: BranchToCreateLatestTag
default: main
- name: Platform
type: string
default: linux
values:
- linux
- windows
- name: WorkingDirectory
default: $(Build.SourcesDirectory)

steps:
- task: AzureCLI@2
Expand All @@ -14,7 +23,7 @@ steps:
azureSubscription: ${{ parameters.ServiceConnection }}
scriptType: pscore
scriptLocation: inlineScript
inlineScript: 'az acr build --registry ${{ parameters.ContainerRegistryName }} --image ${{ parameters.ImageName }}:$(build.buildnumber) ${{ parameters.AdditionalArgs }} .'
inlineScript: 'az acr build --registry ${{ parameters.ContainerRegistryName }} --image ${{ parameters.ImageName }}:$(build.buildnumber) --platform ${{ parameters.Platform }} ${{ parameters.AdditionalArgs }} .'
workingDirectory: ${{ parameters.WorkingDirectory }}
- task: AzureCLI@2
displayName: 'Build Image with latest tag if branch matches BranchToCreateLatestTag parameter'
Expand All @@ -23,5 +32,5 @@ steps:
azureSubscription: ${{ parameters.ServiceConnection }}
scriptType: pscore
scriptLocation: inlineScript
inlineScript: 'az acr build --registry ${{ parameters.ContainerRegistryName }} --image ${{ parameters.ImageName }}:latest ${{ parameters.AdditionalArgs }} .'
inlineScript: 'az acr build --registry ${{ parameters.ContainerRegistryName }} --image ${{ parameters.ImageName }}:latest --platform ${{ parameters.Platform }} ${{ parameters.AdditionalArgs }} .'
workingDirectory: ${{ parameters.WorkingDirectory }}

0 comments on commit 83ebd5f

Please sign in to comment.