From 1008a1fc90dfc0bb488377be6a71edd6b4c5d771 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 6 Oct 2020 10:56:11 -0700 Subject: [PATCH] Build images for gerrit 3.1 and 3.2 This will allow us to test further gerrit upgrades while we sort out how far into the gerrit releases we will be upgrading to on our next upgrade. Change-Id: Ic9d07b76e41ad4262cc0e2e1ff8a5d554f88239e --- playbooks/zuul/gerrit/repos.yaml | 17 +-- playbooks/zuul/gerrit/submodules.yaml | 2 +- zuul.d/docker-images/gerrit.yaml | 209 ++++++++++++++++++++++++++ 3 files changed, 217 insertions(+), 11 deletions(-) diff --git a/playbooks/zuul/gerrit/repos.yaml b/playbooks/zuul/gerrit/repos.yaml index 7558e8463d..37154813d7 100644 --- a/playbooks/zuul/gerrit/repos.yaml +++ b/playbooks/zuul/gerrit/repos.yaml @@ -26,10 +26,13 @@ - javamelody - replication - reviewnotes + - download-commands + - singleusergroup - # There is no stable branch for download-commands and no 3.0 branch of - # singleusergroup so we need to check out the actual ref defined in the - # parent repo. The default zuul remote, file:///dev/null, doesn't work + # Some submodules don't have appropriate refs to checkout for specific + # gerrit branches. We address that by checking them out explicitly in + # submodules.yaml on branches that need it. + # The default zuul remote, file:///dev/null, doesn't work # here because relative paths cause it to be # file:///dev/plugins/download-commands, which isn't a thing. Removing # the origin causes git to use relative local filesystem paths. @@ -37,13 +40,7 @@ command: "git remote rm origin" args: chdir: /home/zuul/src/gerrit.googlesource.com/gerrit - - name: Checkout core plugin submodules - command: "git submodule update --init plugins/{{ item }}" - args: - chdir: /home/zuul/src/gerrit.googlesource.com/gerrit - loop: - - download-commands - - singleusergroup + - name: Move additional plugin repos into gerrit tree command: "mv -f {{ item }} ../gerrit/plugins" args: diff --git a/playbooks/zuul/gerrit/submodules.yaml b/playbooks/zuul/gerrit/submodules.yaml index 6ca4cfaafb..8837275f06 100644 --- a/playbooks/zuul/gerrit/submodules.yaml +++ b/playbooks/zuul/gerrit/submodules.yaml @@ -2,7 +2,7 @@ tasks: - name: Checkout submodules - shell: "[ -d {{ item }} ] && git submodule update --init {{ item }}" + shell: "if [ -d {{ item }} ] ; then git submodule update --init {{ item }} ; fi" args: chdir: /home/zuul/src/gerrit.googlesource.com/gerrit loop: diff --git a/zuul.d/docker-images/gerrit.yaml b/zuul.d/docker-images/gerrit.yaml index 4a4558de1d..4bd0ac56d6 100644 --- a/zuul.d/docker-images/gerrit.yaml +++ b/zuul.d/docker-images/gerrit.yaml @@ -358,6 +358,193 @@ vars: *gerrit_vars_3_0 files: *gerrit_files_3_0 +# Gerrit 3.1 jobs +- job: + name: system-config-build-image-gerrit-3.1 + description: Build a gerrit image. + parent: system-config-build-image + pre-run: + - playbooks/zuul/gerrit/repos.yaml + - playbooks/zuul/gerrit/submodules.yaml + run: playbooks/zuul/gerrit/run.yaml + requires: gerrit-base-container-image + provides: gerrit-3.1-container-image + required-projects: &gerrit_projects_3_1 + - name: opendev/system-config + override-checkout: master + - name: gerrit.googlesource.com/gerrit + override-checkout: stable-3.1 + # Plugins common to every build with branches or refs for every build + - name: gerrit.googlesource.com/plugins/commit-message-length-validator + override-checkout: v3.1.8 + - name: gerrit.googlesource.com/plugins/hooks + override-checkout: v3.1.8 + - name: gerrit.googlesource.com/plugins/its-base + override-checkout: stable-3.1 + - name: gerrit.googlesource.com/plugins/its-storyboard + # There is no 3.1 branch + override-checkout: master + - name: gerrit.googlesource.com/plugins/javamelody + override-checkout: stable-3.1 + - name: gerrit.googlesource.com/plugins/replication + override-checkout: stable-3.1 + - name: gerrit.googlesource.com/plugins/reviewnotes + override-checkout: stable-3.1 + # Plugins common to every build without branches or refs for every build + - name: gerrit.googlesource.com/plugins/download-commands + override-checkout: v3.1.8 + - name: gerrit.googlesource.com/plugins/singleusergroup + override-checkout: v3.1.8 + # Plugins not common to every build + - name: gerrit.googlesource.com/plugins/codemirror-editor + override-checkout: v3.1.8 + - name: gerrit.googlesource.com/plugins/delete-project + override-checkout: stable-3.1 + - name: gerrit.googlesource.com/plugins/gitiles + override-checkout: v3.1.8 + - name: gerrit.googlesource.com/plugins/plugin-manager + override-checkout: v3.1.8 + - name: gerrit.googlesource.com/plugins/webhooks + override-checkout: v3.1.8 + # Non plugin submodules + - name: gerrit.googlesource.com/jgit + override-checkout: master + vars: &gerrit_vars_3_1 + docker_images: + - context: docker/gerrit/bazel + repository: opendevorg/gerrit + target: gerrit + path: /home/zuul/src/gerrit.googlesource.com/gerrit + tags: + - 3.1 + gerrit_additional_plugins: + - codemirror-editor + - delete-project + - gitiles + - plugin-manager + - webhooks + files: &gerrit_files_3_1 + - docker/gerrit/base/ + - docker/gerrit/bazel/ + - playbooks/zuul/gerrit/ + - jeepyb/ + +- job: + name: system-config-upload-image-gerrit-3.1 + description: Build and upload a gerrit image. + parent: system-config-upload-image + pre-run: + - playbooks/zuul/gerrit/repos.yaml + - playbooks/zuul/gerrit/submodules.yaml + run: playbooks/zuul/gerrit/run.yaml + requires: gerrit-base-container-image + provides: gerrit-3.1-container-image + required-projects: *gerrit_projects_3_1 + vars: *gerrit_vars_3_1 + files: *gerrit_files_3_1 + +- job: + name: system-config-promote-image-gerrit-3.1 + description: Promote a previously published gerrit image to latest. + parent: system-config-promote-image + vars: *gerrit_vars_3_1 + files: *gerrit_files_3_1 + +# Gerrit 3.2 jobs +- job: + name: system-config-build-image-gerrit-3.2 + description: Build a gerrit image. + parent: system-config-build-image + pre-run: + - playbooks/zuul/gerrit/repos.yaml + - playbooks/zuul/gerrit/submodules.yaml + run: playbooks/zuul/gerrit/run.yaml + requires: gerrit-base-container-image + provides: gerrit-3.2-container-image + required-projects: &gerrit_projects_3_2 + - name: opendev/system-config + override-checkout: master + - name: gerrit.googlesource.com/gerrit + override-checkout: stable-3.2 + # Plugins common to every build with branches or refs for every build + - name: gerrit.googlesource.com/plugins/commit-message-length-validator + override-checkout: v3.2.3 + - name: gerrit.googlesource.com/plugins/hooks + override-checkout: v3.2.3 + - name: gerrit.googlesource.com/plugins/its-base + override-checkout: stable-3.2 + - name: gerrit.googlesource.com/plugins/its-storyboard + # There is no 3.2 branch + override-checkout: master + - name: gerrit.googlesource.com/plugins/javamelody + # There is no 3.2 branch + override-checkout: master + - name: gerrit.googlesource.com/plugins/replication + override-checkout: stable-3.2 + - name: gerrit.googlesource.com/plugins/reviewnotes + override-checkout: stable-3.2 + # Plugins common to every build without branches or refs for every build + - name: gerrit.googlesource.com/plugins/download-commands + override-checkout: v3.2.3 + - name: gerrit.googlesource.com/plugins/singleusergroup + override-checkout: v3.2.3 + # Plugins not common to every build + - name: gerrit.googlesource.com/plugins/codemirror-editor + override-checkout: v3.2.3 + - name: gerrit.googlesource.com/plugins/delete-project + override-checkout: stable-3.2 + - name: gerrit.googlesource.com/plugins/gitiles + override-checkout: v3.2.3 + - name: gerrit.googlesource.com/plugins/plugin-manager + override-checkout: v3.2.3 + - name: gerrit.googlesource.com/plugins/webhooks + override-checkout: v3.2.3 + # Non plugin submodules + - name: gerrit.googlesource.com/jgit + override-checkout: master + - name: gerrit.googlesource.com/polymer-bridges + override-checkout: v3.2.3 + vars: &gerrit_vars_3_2 + docker_images: + - context: docker/gerrit/bazel + repository: opendevorg/gerrit + target: gerrit + path: /home/zuul/src/gerrit.googlesource.com/gerrit + tags: + - 3.2 + gerrit_additional_plugins: + - codemirror-editor + - delete-project + - gitiles + - plugin-manager + - webhooks + files: &gerrit_files_3_2 + - docker/gerrit/base/ + - docker/gerrit/bazel/ + - playbooks/zuul/gerrit/ + - jeepyb/ + +- job: + name: system-config-upload-image-gerrit-3.2 + description: Build and upload a gerrit image. + parent: system-config-upload-image + pre-run: + - playbooks/zuul/gerrit/repos.yaml + - playbooks/zuul/gerrit/submodules.yaml + run: playbooks/zuul/gerrit/run.yaml + requires: gerrit-base-container-image + provides: gerrit-3.2-container-image + required-projects: *gerrit_projects_3_2 + vars: *gerrit_vars_3_2 + files: *gerrit_files_3_2 + +- job: + name: system-config-promote-image-gerrit-3.2 + description: Promote a previously published gerrit image to latest. + parent: system-config-promote-image + vars: *gerrit_vars_3_2 + files: *gerrit_files_3_2 + # Gerrit master jobs - job: name: system-config-build-image-gerrit-master-base @@ -479,6 +666,16 @@ - name: opendev-buildset-registry - name: system-config-build-image-gerrit-base soft: true + - system-config-build-image-gerrit-3.1: + dependencies: + - name: opendev-buildset-registry + - name: system-config-build-image-gerrit-base + soft: true + - system-config-build-image-gerrit-3.2: + dependencies: + - name: opendev-buildset-registry + - name: system-config-build-image-gerrit-base + soft: true - system-config-build-image-gerrit-master: voting: false dependencies: @@ -519,6 +716,16 @@ - name: opendev-buildset-registry - name: system-config-upload-image-gerrit-base soft: true + - system-config-upload-image-gerrit-3.1: + dependencies: + - name: opendev-buildset-registry + - name: system-config-upload-image-gerrit-base + soft: true + - system-config-upload-image-gerrit-3.2: + dependencies: + - name: opendev-buildset-registry + - name: system-config-upload-image-gerrit-base + soft: true deploy: jobs: - system-config-promote-image-gerrit-base @@ -527,3 +734,5 @@ - system-config-promote-image-gerrit-2.15 - system-config-promote-image-gerrit-2.16 - system-config-promote-image-gerrit-3.0 + - system-config-promote-image-gerrit-3.1 + - system-config-promote-image-gerrit-3.2