Skip to content

Commit 8666026

Browse files
authored
Merge branch 'master' into PRE_CLEAR_INIT_GROOVY_D
2 parents f5fd303 + c02e403 commit 8666026

File tree

92 files changed

+4427
-2382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+4427
-2382
lines changed

.ci/publish.sh

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#!/bin/bash -eu
2+
3+
# Publish any versions of the docker image not yet pushed to ${JENKINS_REPO}
4+
# Arguments:
5+
# -n dry run, do not build or publish images
6+
# -d debug
7+
8+
: "${JENKINS_VERSION:?Variable \$JENKINS_VERSION not set or empty.}"
9+
10+
set -eu -o pipefail
11+
12+
: "${DOCKERHUB_ORGANISATION:=jenkins}"
13+
: "${DOCKERHUB_REPO:=jenkins}"
14+
15+
export JENKINS_REPO="${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}"
16+
17+
function sort-versions() {
18+
if [ "$(uname)" == 'Darwin' ]; then
19+
gsort --version-sort
20+
else
21+
sort --version-sort
22+
fi
23+
}
24+
25+
# Process arguments
26+
dry_run=false
27+
debug=false
28+
29+
while [[ $# -gt 0 ]]; do
30+
key="$1"
31+
case $key in
32+
-n)
33+
dry_run=true
34+
;;
35+
-d)
36+
debug=true
37+
;;
38+
*)
39+
echo "ERROR: Unknown option: $key"
40+
exit 1
41+
;;
42+
esac
43+
shift
44+
done
45+
46+
47+
if [ "$debug" = true ]; then
48+
echo "Debug mode enabled"
49+
set -x
50+
fi
51+
52+
if [ "$dry_run" = true ]; then
53+
echo "Dry run, will not publish images"
54+
fi
55+
56+
# Retrieve all the Jenkins versions from Artifactory
57+
all_jenkins_versions="$(curl --disable --fail --silent --show-error --location \
58+
https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-war/maven-metadata.xml \
59+
| grep '<version>.*</version>')"
60+
61+
latest_lts_version="$(echo "${all_jenkins_versions}" | grep -E -o '[0-9]\.[0-9]+\.[0-9]' | sort-versions | tail -n1)"
62+
latest_weekly_version="$(echo "${all_jenkins_versions}" | grep -E -o '[0-9]\.[0-9]+' | sort-versions | tail -n 1)"
63+
64+
if [[ "${JENKINS_VERSION}" == "${latest_weekly_version}" ]]
65+
then
66+
LATEST_WEEKLY="true"
67+
else
68+
LATEST_WEEKLY="false"
69+
fi
70+
71+
if [[ "${JENKINS_VERSION}" == "${latest_lts_version}" ]]
72+
then
73+
LATEST_LTS="true"
74+
else
75+
LATEST_LTS="false"
76+
fi
77+
78+
build_opts=("--pull")
79+
if test "${dry_run}" == "true"; then
80+
build_opts+=("--load")
81+
else
82+
build_opts+=("--push")
83+
fi
84+
85+
JENKINS_SHA="$(curl --disable --fail --silent --show-error --location "https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war.sha256")"
86+
COMMIT_SHA=$(git rev-parse HEAD)
87+
export COMMIT_SHA JENKINS_VERSION JENKINS_SHA LATEST_WEEKLY LATEST_LTS
88+
89+
cat <<EOF
90+
Using the following settings:
91+
* JENKINS_REPO: ${JENKINS_REPO}
92+
* JENKINS_VERSION: ${JENKINS_VERSION}
93+
* JENKINS_SHA: ${JENKINS_SHA}
94+
* COMMIT_SHA: ${COMMIT_SHA}
95+
* LATEST_WEEKLY: ${LATEST_WEEKLY}
96+
* LATEST_LTS: ${LATEST_LTS}
97+
EOF
98+
99+
docker buildx bake --file docker-bake.hcl "${build_opts[@]}" linux

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://docs.github.com/en/repositories/working-with-files/using-files/viewing-and-understanding-files#ignore-commits-in-the-blame-view
2+
# Format Jenkinsfile: https://github.com/jenkinsci/docker/pull/2003
3+
9ade9569a658c0ed27107915d7597fcc98d7a577

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* @jenkinsci/team-docker-packaging
2+
*/rhel/ubi*/ @olivergondza
3+
*/debian/bookworm/hotspot @ksalerno99
4+
*/rhel/ubi9/hotspot @ksalerno99

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
community_bridge: jenkins
2+
custom: ["https://jenkins.io/donate/#why-donate"]

.github/dependabot.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Per https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
5+
# Alpine Linux
6+
7+
- package-ecosystem: docker
8+
directory: "alpine/hotspot"
9+
schedule:
10+
interval: weekly
11+
open-pull-requests-limit: 2
12+
target-branch: master
13+
reviewers:
14+
- MarkEWaite
15+
- slide
16+
labels:
17+
- dependencies
18+
ignore:
19+
# Ignore proposals to update to new versions of Java because updatecli takes care of that.
20+
- dependency-name: "eclipse-temurin"
21+
22+
# Debian Linux
23+
24+
- package-ecosystem: docker
25+
directory: "debian/bookworm/hotspot"
26+
schedule:
27+
interval: weekly
28+
open-pull-requests-limit: 2
29+
target-branch: master
30+
reviewers:
31+
- MarkEWaite
32+
- slide
33+
labels:
34+
- dependencies
35+
ignore:
36+
# Ignore proposals to update to new versions of Java because updatecli takes care of that.
37+
- dependency-name: "eclipse-temurin"
38+
39+
- package-ecosystem: docker
40+
directory: "debian/bookworm-slim/hotspot"
41+
schedule:
42+
interval: weekly
43+
open-pull-requests-limit: 2
44+
target-branch: master
45+
reviewers:
46+
- MarkEWaite
47+
- slide
48+
labels:
49+
- dependencies
50+
ignore:
51+
# Ignore proposals to update to new versions of Java because updatecli takes care of that.
52+
- dependency-name: "eclipse-temurin"
53+
54+
# RHEL UBI
55+
56+
- package-ecosystem: docker
57+
directory: "rhel/ubi9/hotspot"
58+
schedule:
59+
interval: weekly
60+
open-pull-requests-limit: 2
61+
target-branch: master
62+
reviewers:
63+
- olivergondza
64+
- slide
65+
labels:
66+
- dependencies
67+
ignore:
68+
# Ignore proposals to update to new versions of Java because updatecli takes care of that.
69+
- dependency-name: "eclipse-temurin"
70+
71+
# GitHub actions
72+
73+
- package-ecosystem: "github-actions"
74+
target-branch: master
75+
directory: "/"
76+
schedule:
77+
# Check for updates to GitHub Actions every week
78+
interval: "weekly"

.github/release-drafter.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc
22
_extends: .github
3-
# We are using 3-digit LTS versioning here
4-
version-template: $MAJOR.$MINOR.$PATCH
5-
tag-template: jenkins-docker-packaging-$NEXT_PATCH_VERSION
6-
name-template: Jenkins Docker Image $NEXT_PATCH_VERSION
3+
# We are using 2-digit weekly versioning here
4+
version-template: $MAJOR.$MINOR
5+
tag-template: $NEXT_MINOR_VERSION
6+
name-template: $NEXT_MINOR_VERSION
77
template: |
88
<!-- Optional: add a release summary here -->
9-
## 📦 Jenkins Core updates
10-
11-
* Update to Jenkins $NEXT_PATCH_VERSION ([changelog](https://jenkins.io/changelog-stable/#v$NEXT_PATCH_VERSION))
12-
9+
## 📦 Jenkins Core updates
10+
11+
* Update to Jenkins $NEXT_MINOR_VERSION ([changelog](https://www.jenkins.io/changelog/$NEXT_MINOR_VERSION))
12+
1313
$CHANGES
14-
15-
**NOTE:** This is an experimental changelog. See [this page](https://github.com/jenkinsci/docker/blob/master/CHANGELOG.md) for more info

.github/workflows/release-drafter.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Note: additional setup is required, see https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc
2+
3+
name: Release Drafter
4+
5+
on:
6+
push:
7+
branches:
8+
- "master"
9+
workflow_dispatch:
10+
11+
jobs:
12+
update_release_draft:
13+
runs-on: ubuntu-latest
14+
if: github.repository_owner == 'jenkinsci'
15+
steps:
16+
# Drafts your next Release notes as Pull Requests are merged into the default branch
17+
- uses: release-drafter/release-drafter@v6
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: Sync Plugin manager Version
3+
4+
on:
5+
schedule:
6+
- cron: "* 23 * * *"
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
if: github.repository_owner == 'jenkinsci'
13+
steps:
14+
- name: Check out source code
15+
uses: actions/checkout@v4
16+
17+
- name: PLUGIN_CLI_VERSION
18+
id: lts
19+
run: |
20+
NEXT_VERSION=$(curl -sL https://api.github.com/repos/jenkinsci/plugin-installation-manager-tool/releases/latest | jq -r ".tag_name")
21+
if [ -z "$NEXT_VERSION" ] || [ $NEXT_VERSION = "null" ]; then
22+
echo "ERROR: Empty or 'null' latest plugin-installation-manager-tool version returned by GitHub API."
23+
exit 1
24+
fi
25+
echo "next-version=$NEXT_VERSION" >> $GITHUB_OUTPUT
26+
27+
- name: Check if update is available
28+
id: update
29+
run: |
30+
CURRENT_VERSION=$(docker buildx bake -f docker-bake.hcl --print alpine_jdk17 | jq -r ".target.alpine_jdk17.args.PLUGIN_CLI_VERSION")
31+
if [ "$CURRENT_VERSION" = "${{ steps.lts.outputs.next-version }}" ]; then
32+
echo "available=false" >> $GITHUB_OUTPUT
33+
else
34+
echo "available=true" >> $GITHUB_OUTPUT
35+
echo "current-version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
36+
fi
37+
38+
- name: Update LTS version in files
39+
if: ${{ steps.update.outputs.available == 'true' }}
40+
run: |
41+
grep -ilrF ${{ steps.update.outputs.current-version }} ./ | grep -v CHANGELOG.md | xargs sed -i 's/${{ steps.update.outputs.current-version }}/${{ steps.lts.outputs.next-version }}/g'
42+
43+
- name: Changelog
44+
if: ${{ steps.update.outputs.available == 'true' }}
45+
run: |
46+
sed -i '/git commit to be able to get more details./a \\n## ${{ steps.nextversion.outputs.version }}\n\nUpdate Jenkins plugin cli verions to jenkins plugin cli lts release version ${{ steps.lts.outputs.next-version }}\n' CHANGELOG.md
47+
48+
- name: Git Diff
49+
if: ${{ steps.update.outputs.available == 'true' }}
50+
run: |
51+
git diff
52+
# update the changelog
53+
54+
- uses: tibdex/github-app-token@v2
55+
id: generate-token
56+
with:
57+
app_id: ${{ secrets.JENKINS_DEPENDENCY_UPDATER_APP_ID }}
58+
private_key: ${{ secrets.JENKINS_DEPENDENCY_UPDATER_PRIVATE_KEY }}
59+
60+
- name: Create Pull Request
61+
id: cpr
62+
uses: peter-evans/create-pull-request@v7
63+
if: ${{ steps.update.outputs.available == 'true' }}
64+
with:
65+
token: ${{ steps.generate-token.outputs.token }}
66+
commit-message: 'chore(deps): bump plugin manager to ${{ steps.lts.outputs.next-version }}'
67+
author: jenkins-dependency-updater <81680575+jenkins-dependency-updater[bot]@users.noreply.github.com>
68+
committer: jenkins-dependency-updater <81680575+jenkins-dependency-updater[bot]@users.noreply.github.com>
69+
signoff: true
70+
labels: 'dependencies'
71+
title: 'chore(deps): bump plugin manager to ${{ steps.lts.outputs.next-version }}'

.github/workflows/updatecli.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: updatecli
2+
on:
3+
# Allow to be run manually
4+
workflow_dispatch:
5+
schedule:
6+
# Run once per week (to avoid alert fatigue)
7+
- cron: '0 2 * * 1' # Every Monday at 2am UTC
8+
push:
9+
pull_request:
10+
jobs:
11+
updatecli:
12+
runs-on: ubuntu-latest
13+
if: github.repository_owner == 'jenkinsci'
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Install Updatecli in the runner
19+
uses: updatecli/updatecli-action@v2.83.0
20+
21+
- name: Run Updatecli in Dry Run mode
22+
run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml
23+
env:
24+
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Run Updatecli in Apply mode
27+
if: github.ref == 'refs/heads/master'
28+
run: updatecli apply --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml
29+
env:
30+
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
*.tmp
22
bats/
3+
target/
34
tests/functions/init.groovy.d/
45
tests/functions/java_cp/
56
tests/functions/copy_reference_file.log
7+
tests/**/work-*/
68
manifest-tool
79
multiarch/qemu-*
810
multiarch/Dockerfile-*
911
/docker.iml
12+
work-pester-jenkins-windows/
1013
/.idea/
14+
15+
/**/windows/**/jenkins.ps1
16+
/**/windows/**/jenkins-plugin-cli.ps1
17+
/**/windows/**/jenkins-support.psm1
18+
19+
tests/**/Dockerfile\.*

.hadolint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Hadolint configuration file
2+
---
3+
# configure ignore rules
4+
# see https://github.com/hadolint/hadolint#rules for a list of available rules.
5+
6+
ignored:
7+
# Exclusions in this section have been triaged and determined to be false
8+
# positives.
9+
- DL3008 # Pin versions in apt-get install
10+
- DL3018 # Pin versions in apk add
11+
- DL3033 # Specify version with yum install -y <package>-<version>
12+
- DL3041 # Specify version with dnf install -y <package>-<version>
13+
14+
# Here lies technical debt. Exclusions in this section have not yet been
15+
# triaged. When working on on this section, pick an exclusion to triage, then:
16+
# - If it is a false positive, add a "# hadolint ignore=<rule>" suppression,
17+
# then remove the exclusion from this section.
18+
# - If it is not a false positive, fix the bug, then remove the exclusion from
19+
# this section.
20+
- DL3006 # Always tag the version of an image explicitly

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ CHANGELOG
66

77
## Status
88

9-
We are doing experimental changelogs for Jenkins master Docker packaging
10-
([discussion in the developer list](https://groups.google.com/forum/#!topic/jenkinsci-dev/KvV_UjU02gE)).
11-
This release notes represent changes in in the packaging, but not in the bundled WAR files.
12-
Please refer to https://jenkins.io/changelog/ and https://jenkins.io/changelog-stable/ for WAR file changelogs.
9+
We are doing experimental changelogs for Jenkins controller Docker packaging
10+
([discussion in the developer list](https://groups.google.com/forum/#!topic/jenkinsci-dev/KvV_UjU02gE)).
11+
These release notes represent changes in in the packaging, but not in the bundled WAR files.
12+
Please refer to the [weekly changelog](https://jenkins.io/changelog/) and [LTS changelog](https://jenkins.io/changelog-stable/) for WAR file changelogs.
1313

1414
## Version scheme
1515

0 commit comments

Comments
 (0)