Skip to content
Draft
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
10 changes: 9 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,15 @@ stage('Build') {
checkout scm
}

withEnv(["IMAGE_TYPE=${imageType}"]) {
withEnv([
"IMAGE_TYPE=${imageType}",
// DEBUG
"JENKINS_VERSION=2.547",
"WAR_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/2.547/jenkins-war-2.547.war"
]) {
stage('Show env') {
powershell 'env | Sort'
}
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
6 changes: 6 additions & 0 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ if ($JenkinsVersion.Split('.').Count -eq 3) {
# If there is no WAR_URL set, using get.jenkins.io URL depending on the release line
if([String]::IsNullOrWhiteSpace($env:WAR_URL)) {
$env:WAR_URL = 'https://get.jenkins.io/{0}/{1}/jenkins.war' -f $releaseLine, $env:JENKINS_VERSION
Write-Host "Using env:WAR_URL: $env:WAR_URL"
}

# Retrieve the sha256 corresponding to the war file
Expand Down Expand Up @@ -150,6 +151,11 @@ function Initialize-DockerComposeFile {
$yqMainQuery = '.target[] | del(.output) | {(. | key): {\"image\": .tags[0], \"build\": .}}'
# Encapsulate under a top level 'services' map
$yqServicesQuery = '{\"services\": .}'
if ($PSVersionTable.PSVersion.Major -ge 7) {
Write-Host 'Using a query compatible with PowerShell 7'
$yqMainQuery = '.target[] | del(.output) | {(. | key): {"image": .tags[0], "build": .}}'
$yqServicesQuery = '{"services": .}'
}

# - Use docker buildx bake to output image definitions from the "<windowsFlavor>" bake target
# - Convert with yq to the format expected by docker compose
Expand Down