From b210f3aa6e3cc3d10aaff77b85b9c0eac7dff01e Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 24 Apr 2018 21:32:26 +0800 Subject: [PATCH] Add Dockerfile for gerrit and monkey patch The openid support doesn't allow to add custom providers but we like the convenience of a single click. Take the official docker image and patch the HTML template. It seems to have changed little over the time, and it might continue like that... I have filed https://bugs.chromium.org/p/gerrit/issues/detail?id=8828 so that we can drop this hack in the future... Change-Id: I713948fbb93355c2e33e3b92969e2389cb88c938 --- gerrit/Dockerfile | 18 ++++++++++++++++++ gerrit/add_osmocom.diff | 11 +++++++++++ 2 files changed, 29 insertions(+) create mode 100644 gerrit/Dockerfile create mode 100644 gerrit/add_osmocom.diff diff --git a/gerrit/Dockerfile b/gerrit/Dockerfile new file mode 100644 index 00000000..e67c7600 --- /dev/null +++ b/gerrit/Dockerfile @@ -0,0 +1,18 @@ +FROM gerritcodereview/gerrit + +USER root +RUN yum -y install zip unzip patch + +RUN \ + unzip /var/gerrit/bin/gerrit.war WEB-INF/lib/gerrit-openid-libopenid.jar && \ + unzip WEB-INF/lib/gerrit-openid-libopenid.jar com/google/gerrit/httpd/auth/openid/LoginForm.html + +COPY add_osmocom.diff /tmp +RUN patch -p0 < /tmp/add_osmocom.diff + +RUN \ + zip -u WEB-INF/lib/gerrit-openid-libopenid.jar com/google/gerrit/httpd/auth/openid/LoginForm.html && \ + zip -u /var/gerrit/bin/gerrit.war WEB-INF/lib/gerrit-openid-libopenid.jar + +USER gerrit + diff --git a/gerrit/add_osmocom.diff b/gerrit/add_osmocom.diff new file mode 100644 index 00000000..f078a96a --- /dev/null +++ b/gerrit/add_osmocom.diff @@ -0,0 +1,11 @@ +--- com/google/gerrit/httpd/auth/openid/LoginForm.html.orig 2018-04-24 21:07:24.000000000 +0800 ++++ com/google/gerrit/httpd/auth/openid/LoginForm.html 2018-04-24 21:08:26.000000000 +0800 +@@ -70,6 +70,8 @@ +
+
+ ++
Sign in with Osmocom
++ +
+ + Sign in with a Launchpad ID