From d7b726140dd4ecf58de5a5cdebcee502278112a6 Mon Sep 17 00:00:00 2001 From: Paladox Date: Thu, 3 Dec 2020 23:51:34 +0000 Subject: [PATCH] Add an OpenDev theme into our Gerrit image This provides an HTML-only PolyGerrit plugin consistent with our Gitea theming, generously provided by Paladox (many thanks!). Since we have to split some roles in the build playbook, also name the temporary patching role to make the build console a little easier to read. Change-Id: I3baf17d04b2dca34fc23dcab91c00544cedf0ca6 --- docker/gerrit/bazel/Dockerfile | 2 + playbooks/zuul/gerrit/opendevtheme.html | 70 +++++++++++++++++++++++++ playbooks/zuul/gerrit/run.yaml | 13 ++++- 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 playbooks/zuul/gerrit/opendevtheme.html diff --git a/docker/gerrit/bazel/Dockerfile b/docker/gerrit/bazel/Dockerfile index a9fc89dc7b..8966162f4e 100644 --- a/docker/gerrit/bazel/Dockerfile +++ b/docker/gerrit/bazel/Dockerfile @@ -23,6 +23,8 @@ COPY release.war /var/gerrit/bin/gerrit.war RUN mkdir /var/gerrit/plugins && \ unzip -jo /var/gerrit/bin/gerrit.war WEB-INF/plugins/* -d /var/gerrit/plugins +COPY opendevtheme.html /var/gerrit/plugins/opendevtheme.html + FROM gerrit as gerrit-2 # Only Gerrit 2.14, 2.15, and 2.16 need this COPY diff --git a/playbooks/zuul/gerrit/opendevtheme.html b/playbooks/zuul/gerrit/opendevtheme.html new file mode 100644 index 0000000000..b5cc2f4fba --- /dev/null +++ b/playbooks/zuul/gerrit/opendevtheme.html @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + diff --git a/playbooks/zuul/gerrit/run.yaml b/playbooks/zuul/gerrit/run.yaml index dd7768e791..921791f402 100644 --- a/playbooks/zuul/gerrit/run.yaml +++ b/playbooks/zuul/gerrit/run.yaml @@ -1,6 +1,7 @@ - hosts: all tasks: - - shell: | + - name: Patch Gerrit's webapp routes to not shadow x/ + shell: | cd /home/zuul/src/gerrit.googlesource.com/gerrit # Disable the x/ redirection since we have x/ projects sed -i -e 's|"/x/\*"\,$|//"/x/*",|g' java/com/google/gerrit/httpd/raw/StaticModule.java @@ -9,6 +10,16 @@ roles: - role: bazelisk-build zuul_work_dir: /home/zuul/src/gerrit.googlesource.com/gerrit + +- hosts: all + tasks: + - name: Install OpenDev theme plugin + copy: + src: opendevtheme.html + dest: /home/zuul/src/gerrit.googlesource.com/gerrit/opendevtheme.html + +- hosts: all + roles: - build-docker-image - hosts: localhost