Skip to content

Commit 535650c

Browse files
authored
Merge branch 'master' into master
2 parents 7b82885 + 25ef236 commit 535650c

File tree

10 files changed

+217
-150
lines changed

10 files changed

+217
-150
lines changed

.github/workflows/updatecli.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/checkout@v4
1616

1717
- name: Install Updatecli in the runner
18-
uses: updatecli/updatecli-action@v2.79.0
18+
uses: updatecli/updatecli-action@v2.81.0
1919

2020
- name: Run Updatecli in Dry Run mode
2121
run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml --values ./updatecli/values.temurin.yaml

Jenkinsfile

Lines changed: 86 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
final String cronExpr = env.BRANCH_IS_PRIMARY ? '@daily' : ''
2+
3+
properties([
4+
buildDiscarder(logRotator(numToKeepStr: '10')),
5+
disableConcurrentBuilds(abortPrevious: true),
6+
pipelineTriggers([cron(cronExpr)]),
7+
])
8+
19
def agentSelector(String imageType) {
210
// Linux agent
311
if (imageType == 'linux') {
4-
return 'linux'
12+
// This function is defined in the jenkins-infra/pipeline-library
13+
if (infra.isTrusted()) {
14+
return 'linux'
15+
} else {
16+
// Need Docker and a LOT of memory for faster builds (due to multi archs) or fallback to linux (trusted.ci)
17+
return 'docker-highmem'
18+
}
519
}
620
// Windows Server Core 2022 agent
721
if (imageType.contains('2022')) {
@@ -11,85 +25,85 @@ def agentSelector(String imageType) {
1125
return 'windows-2019'
1226
}
1327

14-
pipeline {
15-
agent none
28+
// Ref. https://github.com/jenkins-infra/pipeline-library/pull/917
29+
def spotAgentSelector(String agentLabel, int counter) {
30+
// This function is defined in the jenkins-infra/pipeline-library
31+
if (infra.isTrusted()) {
32+
// Return early if on trusted (no spot agent)
33+
return agentLabel
34+
}
1635

17-
options {
18-
buildDiscarder(logRotator(daysToKeepStr: '10'))
36+
if (counter > 1) {
37+
return agentLabel + ' && nonspot'
1938
}
2039

21-
stages {
22-
stage('docker-ssh-agent') {
23-
environment {
24-
DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}"
25-
}
26-
matrix {
27-
axes {
28-
axis {
29-
name 'IMAGE_TYPE'
30-
values 'linux', 'nanoserver-1809', 'nanoserver-ltsc2019', 'nanoserver-ltsc2022', 'windowsservercore-ltsc2019', 'windowsservercore-ltsc2022'
31-
}
32-
}
33-
stages {
34-
stage('Main') {
35-
agent {
36-
label agentSelector(env.IMAGE_TYPE)
37-
}
38-
options {
39-
timeout(time: 60, unit: 'MINUTES')
40-
}
41-
stages {
40+
return agentLabel + ' && spot'
41+
}
42+
43+
// Specify parallel stages
44+
def parallelStages = [failFast: false]
45+
[
46+
'linux',
47+
'nanoserver-1809',
48+
'nanoserver-ltsc2019',
49+
'nanoserver-ltsc2022',
50+
'windowsservercore-1809',
51+
'windowsservercore-ltsc2019',
52+
'windowsservercore-ltsc2022'
53+
].each { imageType ->
54+
parallelStages[imageType] = {
55+
withEnv([
56+
"IMAGE_TYPE=${imageType}",
57+
"REGISTRY_ORG=${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}",
58+
]) {
59+
int retryCounter = 0
60+
retry(count: 2, conditions: [agent(), nonresumable()]) {
61+
// Use local variable to manage concurrency and increment BEFORE spinning up any agent
62+
final String resolvedAgentLabel = spotAgentSelector(agentSelector(imageType), retryCounter)
63+
retryCounter++
64+
node(resolvedAgentLabel) {
65+
timeout(time: 60, unit: 'MINUTES') {
66+
checkout scm
67+
if (imageType == "linux") {
4268
stage('Prepare Docker') {
43-
when {
44-
environment name: 'IMAGE_TYPE', value: 'linux'
45-
}
46-
steps {
47-
sh 'make docker-init'
48-
}
69+
sh 'make docker-init'
4970
}
50-
stage('Build and Test') {
51-
// This stage is the "CI" and should be run on all code changes triggered by a code change
52-
when {
53-
not { buildingTag() }
54-
}
55-
steps {
56-
script {
57-
if(isUnix()) {
58-
sh 'make build'
59-
sh 'make test'
60-
// If the tests are passing for Linux AMD64, then we can build all the CPU architectures
61-
sh 'make every-build'
71+
}
72+
// This function is defined in the jenkins-infra/pipeline-library
73+
if (infra.isTrusted()) {
74+
// trusted.ci.jenkins.io builds (e.g. publication to DockerHub)
75+
stage('Deploy to DockerHub') {
76+
withEnv([
77+
"ON_TAG=true",
78+
"VERSION=${env.TAG_NAME}",
79+
]) {
80+
// This function is defined in the jenkins-infra/pipeline-library
81+
infra.withDockerCredentials {
82+
if (isUnix()) {
83+
sh 'make publish'
6284
} else {
63-
powershell '& ./build.ps1 test'
85+
powershell '& ./build.ps1 publish'
6486
}
6587
}
6688
}
67-
post {
68-
always {
69-
junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml')
70-
}
71-
}
7289
}
73-
stage('Deploy to DockerHub') {
74-
// This stage is the "CD" and should only be run when a tag triggered the build
75-
when {
76-
buildingTag()
77-
}
78-
environment {
79-
ON_TAG = 'true'
80-
VERSION = "${env.TAG_NAME}"
90+
} else {
91+
stage('Build and Test') {
92+
// ci.jenkins.io builds (e.g. no publication)
93+
if (isUnix()) {
94+
sh 'make build'
95+
sh 'make test'
96+
} else {
97+
powershell '& ./build.ps1 test'
98+
archiveArtifacts artifacts: 'build-windows_*.yaml', allowEmptyArchive: true
8199
}
82-
steps {
83-
script {
84-
// This function is defined in the jenkins-infra/pipeline-library
85-
infra.withDockerCredentials {
86-
if (isUnix()) {
87-
sh 'make publish'
88-
} else {
89-
powershell '& ./build.ps1 publish'
90-
}
91-
}
92-
}
100+
junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml')
101+
}
102+
// If the tests are passing for Linux AMD64, then we can build all the CPU architectures
103+
if (isUnix()) {
104+
stage('Multi-Arch Build') {
105+
106+
sh 'make every-build'
93107
}
94108
}
95109
}
@@ -100,4 +114,6 @@ pipeline {
100114
}
101115
}
102116

103-
// vim: ft=groovy
117+
// Execute parallel stages
118+
parallel parallelStages
119+
// // vim: ft=groovy

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ check-reqs:
4040

4141
## This function is specific to Jenkins infrastructure and isn't required in other contexts
4242
docker-init: check-reqs
43-
@set -x; docker buildx create --use
43+
ifeq ($(CI),true)
44+
ifeq ($(wildcard /etc/buildkitd.toml),)
45+
echo 'WARNING: /etc/buildkitd.toml not found, using default configuration.'
46+
docker buildx create --use --bootstrap --driver docker-container
47+
else
48+
docker buildx create --use --bootstrap --driver docker-container --config /etc/buildkitd.toml
49+
endif
50+
else
51+
docker buildx create --use --bootstrap --driver docker-container
52+
endif
4453
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
4554

4655
build: check-reqs

alpine/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ RUN apk add --no-cache \
8888
musl-locales \
8989
netcat-openbsd \
9090
openssh \
91-
patch
91+
patch \
92+
# Cleanup SSH host keys if any
93+
&& rm -f /etc/ssh/ssh_host*_key*
9294

9395
# setup SSH server
9496
RUN sed -i /etc/ssh/sshd_config \

debian/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
# THE SOFTWARE.
22-
ARG DEBIAN_RELEASE=bookworm-20250317
23-
FROM debian:"${DEBIAN_RELEASE}"-slim as jre-build
22+
ARG DEBIAN_RELEASE=bookworm-20250407
23+
FROM debian:"${DEBIAN_RELEASE}"-slim AS jre-build
2424

2525
SHELL ["/bin/bash", "-e", "-u", "-o", "pipefail", "-c"]
2626

@@ -87,7 +87,10 @@ RUN apt-get update \
8787
netcat-traditional \
8888
openssh-server \
8989
patch \
90-
&& rm -rf /var/lib/apt/lists/*
90+
# Cleanup APT cache
91+
&& rm -rf /var/lib/apt/lists/* \
92+
# Cleanup SSH host keys if any
93+
&& rm -f /etc/ssh/ssh_host*_key*
9194

9295
# setup SSH server
9396
RUN sed -i /etc/ssh/sshd_config \

docker-bake.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ variable "JAVA21_VERSION" {
7272
}
7373

7474
variable "DEBIAN_RELEASE" {
75-
default = "bookworm-20250317"
75+
default = "bookworm-20250407"
7676
}
7777

7878
# Set this value to a specific Windows version to override Windows versions to build returned by windowsversions function

0 commit comments

Comments
 (0)