Skip to content

Commit

Permalink
Feat!: Upgrade Jenkins-job-builder to 6x
Browse files Browse the repository at this point in the history
Jenkins Job Builder 6.0.0 is released and breaks backward
compatibility with 5.1.0.

The breaking changes with previous 5.1.0 release:

- Jobs are now expanded the same way as job templates.
- Macros without parameters are now expanded the same way as macros
  with parameters.
- Tags !include-raw: and !include-raw-escape: should now be used the
  same way in jobs and macros without parameters as they are used in
  job templates and macros with parameters.

Note: This breaks backward compatibility with older version of JJB
therefore care must be taken when upgrading the ci-man repositories.

Ref:
https://storyboard.openstack.org/#!/story/2010963
https://storyboard.openstack.org/#!/story/2010588

Issue: RELENG-5118
Change-Id: Ib9acd0b9e7c264ac3531af858431e738397833b5
Signed-off-by: Anil Belur <[email protected]>
  • Loading branch information
askb committed Feb 1, 2024
1 parent 766dbef commit 5d33657
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 15 deletions.
2 changes: 1 addition & 1 deletion jjb/lf-ci-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
disable-job: false
github-url: "https://github.com"
jjb-cache: "$HOME/.cache/jenkins_jobs"
jjb-version: 5.1.0
jjb-version: 6.0.0
stream: master
submodule-recursive: true
submodule-timeout: 10
Expand Down
18 changes: 9 additions & 9 deletions jjb/lf-macros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- builder:
name: lf-fetch-dependent-patches
builders:
- shell: !include-raw: ../shell/gerrit-fetch-dependencies.sh
- shell: !include-raw-escape: ../shell/gerrit-fetch-dependencies.sh
- inject:
properties-file: $WORKSPACE/.dependency.properties

Expand All @@ -42,7 +42,7 @@
- builder:
name: lf-infra-capture-instance-metadata
builders:
- shell: !include-raw:
- shell: !include-raw-escape:
- ../shell/capture-instance-metadata.sh

- builder:
Expand Down Expand Up @@ -100,11 +100,11 @@
# Ensure python-tools are installed in case job template does not
# call the lf-infra-pre-build macro.
- ../shell/python-tools-install.sh
- shell: !include-raw:
- shell: !include-raw-escape:
- ../shell/sudo-logs.sh
- shell: !include-raw:
- shell: !include-raw-escape:
- ../shell/job-cost.sh
- shell: !include-raw:
- shell: !include-raw-escape:
- ../shell/logs-deploy.sh
- shell: !include-raw:
- ../shell/logs-clear-credentials.sh
Expand All @@ -114,7 +114,7 @@
- builder:
name: lf-infra-package-listing
builders:
- shell: !include-raw:
- shell: !include-raw-escape:
- ../shell/package-listing.sh

- builder:
Expand Down Expand Up @@ -179,7 +179,7 @@
- builder:
name: lf-infra-update-packer-images
builders:
- shell: !include-raw: ../shell/update-cloud-images.sh
- shell: !include-raw-escape: ../shell/update-cloud-images.sh

- builder:
name: lf-infra-push-gerrit-patch
Expand All @@ -197,7 +197,7 @@
- builder:
name: lf-infra-sysstat
builders:
- shell: !include-raw:
- shell: !include-raw-escape:
- ../shell/sysstat.sh

- builder:
Expand Down Expand Up @@ -343,7 +343,7 @@
files:
- file-id: lftoolsini
target: "$HOME/.config/lftools/lftools.ini"
- shell: !include-raw: ../shell/release-job.sh
- shell: !include-raw-escape: ../shell/release-job.sh

- builder:
name: lf-sigul-sign-dir
Expand Down
2 changes: 1 addition & 1 deletion jjb/lf-maven-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- builder:
name: lf-maven-deploy
builders:
- shell: !include-raw:
- shell: !include-raw-escape:
- ../shell/common-variables.sh
- ../shell/maven-deploy.sh

Expand Down
24 changes: 24 additions & 0 deletions releasenotes/notes/upgrade-jjb-6x-00f29f4ed84cedce.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
prelude: >
Jenkins Job Builder 6.0.0 is released and breaks backward compatibility
with 5.1.0.
The breaking changes with previous 5.1.0 release:
- Jobs are now expanded the same way as job templates.
- Macros without parameters are now expanded the same way as macros with
parameters.
- Tags !include-raw: and !include-raw-escape: should now be used the same
way in jobs and macros without parameters as they are used in job
templates and macros with parameters.
issues:
- |
This breaks backward compatibility with older version of JJB
therefore care must be taken during upgrade on the ci-man repositories.
upgrade:
- |
Upgrade Jenkins-job-builder to 6.0.0 as the default version.
Ref:
https://storyboard.openstack.org/#!/story/2010963
https://storyboard.openstack.org/#!/story/2010588
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ commands =
[testenv:jjb]
basepython = python3
deps =
jenkins-job-builder==5.1.0
jenkins-job-builder==6.0.0
commands =
jenkins-jobs -l DEBUG test --recursive -o {toxinidir}/archives/job-configs {toxinidir}/jjb:{toxinidir}/.jjb-test

[testenv:jjb-compare-xml]
basepython = python3
deps =
jenkins-job-builder==5.1.0
jenkins-job-builder
allowlist_externals =
./jjb-compare-xml.sh
commands =
Expand All @@ -42,7 +42,7 @@ commands =
[testenv:jjb-latest]
basepython = python3
deps =
jenkins-job-builder==5.1.0
jenkins-job-builder
commands =
jenkins-jobs -l DEBUG test --recursive -o {toxinidir}/archives/job-configs {toxinidir}/jjb:{toxinidir}/.jjb-test

Expand Down Expand Up @@ -103,7 +103,7 @@ commands =

[testenv:jenkins-jobs]
deps =
jenkins-job-builder{env:JJB_VERSION_OP:~=}{env:JJB_VERSION:5.1.0}
jenkins-job-builder{env:JJB_VERSION_OP:~=}{env:JJB_VERSION:6.0.0}
commands =
jenkins-jobs {posargs:--help}

Expand Down

0 comments on commit 5d33657

Please sign in to comment.