File tree Expand file tree Collapse file tree 3 files changed +62
-24
lines changed Expand file tree Collapse file tree 3 files changed +62
-24
lines changed Original file line number Diff line number Diff line change @@ -21,17 +21,24 @@ stages:
21
21
dependsOn : Build
22
22
condition : succeeded()
23
23
jobs :
24
- - job : Docker
25
- strategy :
26
- matrix :
27
- ' Windows ' :
28
- VM_IMAGE : ' windows-2019'
29
- ' Linux ' :
30
- VM_IMAGE : ' Ubuntu 16.04'
24
+ - job : Generator
25
+ displayName : ' Generate Docker jobs'
31
26
pool :
32
- vmImage : $(VM_IMAGE)
27
+ vmImage : windows-2019
33
28
steps :
34
- - template : build/stages/docker.yml
29
+ - pwsh : ./src/Docker/docker.ps1 -os windows -variant runtime
30
+ name : matrix_Windows
31
+ - pwsh : ./src/Docker/docker.ps1 -os linux -variant runtime
32
+ name : matrix_Linux
33
+
34
+ - template : build/stages/docker.yml
35
+ parameters :
36
+ name : Linux
37
+ vmImage : ' Ubuntu 16.04'
38
+ - template : build/stages/docker.yml
39
+ parameters :
40
+ name : Windows
41
+ vmImage : ' windows-2019'
35
42
36
43
- stage : Publish
37
44
dependsOn : Build
@@ -41,4 +48,4 @@ stages:
41
48
pool :
42
49
vmImage : windows-2019
43
50
steps :
44
- - template : build/stages/publish.yml
51
+ - template : build/stages/publish.yml
Original file line number Diff line number Diff line change 1
- steps :
2
- - template : common-steps.yml
3
- - task : DownloadPipelineArtifact@2
4
- displayName : ' Download pipeline artifacts'
5
- inputs :
6
- source : current
7
- path : $(Build.SourcesDirectory)
8
- artifact : artifacts
9
- - script : dotnet cake build.cake --bootstrap && dotnet cake build.cake --target=Publish-DockerHub
10
- displayName : ' Docker build'
11
- env :
12
- DOCKER_USERNAME : $(DOCKER_USERNAME)
13
- DOCKER_PASSWORD : $(DOCKER_PASSWORD)
14
- ENABLED_PUBLISH_DOCKER : $(ENABLED_PUBLISH_DOCKER)
1
+ parameters :
2
+ name : ' '
3
+ vmImage : ' '
4
+
5
+ jobs :
6
+ - job : Docker_${{ parameters.name }}
7
+ displayName : ' Docker ${{ parameters.name }}'
8
+ pool :
9
+ vmImage : ${{ parameters.vmImage }}
10
+ dependsOn : Generator
11
+ strategy :
12
+ matrix : $[ dependencies['Generator'].outputs['matrix_${{ parameters.name }}.dockerConfigs'] ]
13
+ steps :
14
+ - template : common-steps.yml
15
+ - task : DownloadPipelineArtifact@2
16
+ displayName : ' Download pipeline artifacts'
17
+ inputs :
18
+ source : current
19
+ path : $(Build.SourcesDirectory)
20
+ artifact : artifacts
21
+ - script : dotnet cake build.cake --bootstrap && dotnet cake build.cake --target=Publish-DockerHub --docker_distro=$(DISTRO) --docker_dotnetversion=$(DOTNET_VERSION)
22
+ displayName : ' Docker build'
23
+ env :
24
+ DOCKER_USERNAME : $(DOCKER_USERNAME)
25
+ DOCKER_PASSWORD : $(DOCKER_PASSWORD)
26
+ ENABLED_PUBLISH_DOCKER : $(ENABLED_PUBLISH_DOCKER)
Original file line number Diff line number Diff line change
1
+ [CmdletBinding ()]
2
+ param (
3
+ [string ]$variant ,
4
+ [string ]$os
5
+ )
6
+ $configs = (Get-Content ./ src/ docker/ docker.json | ConvertFrom-Json ).($os )
7
+
8
+ $map = @ {}
9
+ foreach ($version in $configs.PSObject.Properties ) {
10
+ foreach ($distro in $version.Value ) {
11
+ $entry = @ {}
12
+ $entry.Add (" DOTNET_VERSION" , $version.Name )
13
+ $entry.Add (" DISTRO" , $distro )
14
+ $map.Add (" $ ( $version.Name ) $distro " , [pscustomobject ]$entry )
15
+ }
16
+ }
17
+
18
+ $matrix = ([pscustomobject ]$map | ConvertTo-Json - Compress) -replace " `" " , " '"
19
+ Write-Host " ##vso[task.setVariable variable=dockerConfigs;isOutput=true]$matrix "
You can’t perform that action at this time.
0 commit comments