system-config/playbooks/zuul/gerrit/run.yaml
Ian Wienand 6e232716e7 gerrit: update theme to javascript plugin
Gerrit 3.4 deprecates HTML-based plugins, so the old theme doesn't
work.  I have reworked this into a javascript plugin.

This should look the same, although I've achieved things in different
ways.

This doesn't register light and dark variants; since
background-primary-color is white, by setting the
header-background-color to this we get white behind the header bar,
and it correctly switches to the default black(ish) when in dark mode
(currently its seems the header doesn't obey dark mode, so this is an
improvement).

I'm not sure what's going on with the extant header-border-image which
is a linear gradient all of the same color.  I modified this down to
1px (same as default) and made it fade in-and-out of the logo colour,
just for fun.

Change-Id: Ia2e32731c1cfe97639de2ec0e7660c7ed583e045
2021-11-04 18:45:18 +11:00

65 lines
2.2 KiB
YAML

- hosts: all
tasks:
- name: Build gerrit
include_role:
name: bazelisk-build
vars:
zuul_work_dir: /home/zuul/src/gerrit.googlesource.com/gerrit
# NOTE(ianw): There doesn't seem to be a way to integrate
# polygerrit/javascript plugins into the standard "release"
# target; we add plugins as separate targets here
bazelisk_targets:
- release
- plugins/zuul-results-summary:zuul-results-summary
# Bazel makes "convenience symlinks" [1] starting with bazel-* to
# the actual build output. The problem is that we want to use the
# source tree as the context/build dir for our Docker container,
# and Docker refuses to follow symlinks for COPY commands; i.e. we
# can't copy stuff from the build output into the container.
# Therefore break the bazel-bin link and move to the top level so
# we can copy the built bits (jars, plugins, etc) into the
# container easily.
#
# [1] https://docs.bazel.build/versions/master/user-manual.html
- name: Make bazel-bin docker friendly
shell:
cmd: |
if [ ! -L bazel-bin ]; then
echo "bazel-bin not a symlink?"
exit 1
fi
target=$(readlink bazel-bin)
rm bazel-bin
mv $target bazel-bin
chdir: /home/zuul/src/gerrit.googlesource.com/gerrit
- name: Install static files to container build context
block:
- name: Ensure directories
file:
path: '/home/zuul/src/gerrit.googlesource.com/gerrit/{{ item }}'
state: directory
loop:
- plugins
- static
- name: Copy static files
copy:
src: '{{ item }}'
dest: '/home/zuul/src/gerrit.googlesource.com/gerrit/{{ item }}'
loop:
- static/cla.html
- static/opendev-sm.png
- static/robots.txt
- static/system-cla.html
- static/usg-cla.html
- plugins/opendev-theme-plugin.js
- name: Build docker image
include_role:
name: build-docker-image
- hosts: localhost
roles:
- pause-buildset-registry