File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -55,9 +55,11 @@ def parallelStages = [failFast: false]
5555 node(resolvedAgentLabel) {
5656 timeout(time : 60 , unit : ' MINUTES' ) {
5757 checkout scm
58- if (imageType == " linux " ) {
59- stage( ' Prepare Docker ' ) {
58+ stage( ' Prepare Docker ' ) {
59+ if (isUnix() ) {
6060 sh ' make docker-init'
61+ } else {
62+ powershell ' & ./build.ps1 docker-init'
6163 }
6264 }
6365 // This function is defined in the jenkins-infra/pipeline-library
Original file line number Diff line number Diff line change @@ -122,6 +122,22 @@ function Test-Image {
122122 return $failed
123123}
124124
125+ function Initialize-Docker () {
126+ docker info
127+ # Cf https://github.com/jenkins-infra/jenkins-infra/blob/production/modules/profile/templates/jenkinscontroller/casc/clouds-ec2.yaml.erb
128+ $dockerDaemonConfigPath = ' C:\ProgramData\Docker\config\daemon.json'
129+ if (Test-Path $dockerDaemonConfigPath ) {
130+ $dockerDaemonConfig = Get-Content - Path $dockerDaemonConfigPath - Raw | ConvertFrom-Json
131+ Write-Host " ${dockerDaemonConfigPath} file content:"
132+ $dockerDaemonConfig | ConvertTo-Json
133+ }
134+ # System information
135+ Get-ComputerInfo | Select-Object OsName, OsBuildNumber, WindowsVersion
136+ Get-CimInstance - ClassName Win32_Processor | Out-String
137+ Get-WindowsFeature Containers | Out-String
138+ docker info
139+ }
140+
125141function Initialize-DockerComposeFile {
126142 param (
127143 [String ] $AgentType ,
@@ -173,6 +189,10 @@ Test-CommandExists 'docker-compose'
173189Test-CommandExists ' docker buildx'
174190Test-CommandExists ' yq'
175191
192+ if ($target -eq ' docker-init' ) {
193+ Initialize-Docker
194+ }
195+
176196foreach ($agentType in $AgentTypes ) {
177197 $dockerComposeFile = ' build-windows_{0}_{1}.yaml' -f $AgentType , $ImageType
178198 $baseDockerCmd = ' docker-compose --file={0}' -f $dockerComposeFile
You can’t perform that action at this time.
0 commit comments