Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 32 additions & 27 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,21 @@ stage('Build') {
withEnv(envVars) {
echo '= bake target: linux'

def windowsImageTypes = ['windowsservercore-ltsc2022']
def windowsImageTypes = ['windowsservercore-ltsc2022', 'windowsservercore-ltsc2025']
for (anImageType in windowsImageTypes) {
def imageType = anImageType
builds[imageType] = {
nodeWithTimeout('windows-2022') {
nodeWithTimeout('windows-2025') {
stage('Checkout') {
checkout scm
}

withEnv(["IMAGE_TYPE=${imageType}"]) {
stage('Prepare Docker') {
infra.withDockerCredentials {
powershell './make.ps1 -Target docker-init'
}
}
if (!infra.isTrusted()) {
/* Outside of the trusted.ci environment, we're building and testing
* the Dockerfile in this repository, but not publishing to docker hub
Expand Down Expand Up @@ -119,14 +124,14 @@ stage('Build') {
// This list can be updated with the following command:
// make show | jq -r '.target | keys[]' | sort
def images = [
'alpine_jdk21',
'alpine_jdk25',
'debian_jdk21',
'debian_jdk25',
'debian-slim_jdk21',
'debian-slim_jdk25',
'rhel_jdk21',
'rhel_jdk25',
// 'alpine_jdk21',
// 'alpine_jdk25',
// 'debian_jdk21',
// 'debian_jdk25',
// 'debian-slim_jdk21',
// 'debian-slim_jdk25',
// 'rhel_jdk21',
// 'rhel_jdk25',
]
for (i in images) {
def imageToBuild = i
Expand Down Expand Up @@ -167,23 +172,23 @@ stage('Build') {
}
}
}
// Building every other architectures than amd64 on agents with the corresponding labels if available
architecturesAndCiJioAgentLabels.findAll { arch, _ -> arch != 'amd64' }.each { architecture, labels ->
builds[architecture] = {
nodeWithTimeout(labels) {
stage('Checkout') {
deleteDir()
checkout scm
}
// sanity check that proves all images build on declared platforms not already built in other stages
stage("Multi arch build - ${architecture}") {
infra.withDockerCredentials {
sh "make docker-init listarch-${architecture} buildarch-${architecture}"
}
}
}
}
}
// // Building every other architectures than amd64 on agents with the corresponding labels if available
// architecturesAndCiJioAgentLabels.findAll { arch, _ -> arch != 'amd64' }.each { architecture, labels ->
// builds[architecture] = {
// nodeWithTimeout(labels) {
// stage('Checkout') {
// deleteDir()
// checkout scm
// }
// // sanity check that proves all images build on declared platforms not already built in other stages
// stage("Multi arch build - ${architecture}") {
// infra.withDockerCredentials {
// sh "make docker-init listarch-${architecture} buildarch-${architecture}"
// }
// }
// }
// }
// }
} else {
// Only publish when a tag triggered the build
if (env.TAG_NAME) {
Expand Down
24 changes: 24 additions & 0 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,30 @@ $env:COMMIT_SHA=$(git rev-parse HEAD)
$baseDockerCmd = 'docker-compose --file=build-windows.yaml'
$baseDockerBuildCmd = '{0} build --parallel --pull' -f $baseDockerCmd

function Initialize-Docker() {
# Cf https://github.com/jenkins-infra/jenkins-infra/blob/production/modules/profile/templates/jenkinscontroller/casc/clouds-ec2.yaml.erb
$dockerDaemonConfigPath = 'C:\ProgramData\Docker\config\daemon.json'
if (Test-Path $dockerDaemonConfigPath) {
$dockerDaemonConfig = Get-Content -Path $dockerDaemonConfigPath -Raw | ConvertFrom-Json
Write-Host "${dockerDaemonConfigPath} file content:"
$dockerDaemonConfig | ConvertTo-Json
# Remove docker daemon config setting "data-root" to Z:\docker (NVMe mount) to avoid hitting moby/moby#48093
Remove-Item -Path $dockerDaemonConfigPath
Restart-Service docker
}
Get-ComputerInfo | Select-Object OsName, OsBuildNumber, WindowsVersion
Get-WindowsFeature Containers | Out-String
Invoke-Expression 'docker info'
Get-CimInstance -ClassName Win32_Processor
Get-ChildItem env: | Select-Object Name, Value
}

if($target -eq 'docker-init') {
Write-Host '= Initialize-Docker then exit'
Initialize-Docker
exit 0
}

Write-Host "= PREPARE: List of $Organisation/$Repository images and tags to be processed:"
Invoke-Expression "$baseDockerCmd config"

Expand Down