aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2018-12-07 15:53:09 +0100
committerosmith <osmith@sysmocom.de>2018-12-11 09:13:31 +0000
commit8deb1f1aa8f08593dc21477d871225f7dddda2e3 (patch)
treed215cd3fc94cc5dc41f1072fe34e685a2fe92d69
parentb6ad85bd4cec4a8865a0ec88c2b26a37c13c83a7 (diff)
cosmetic: gerrit: use variables for the files to patch
Make the code more readable, and make it easier to update the paths if they should change again. Change-Id: I285f7908de64f2d92fa99ae9d74fb2e29ec72771
-rw-r--r--gerrit/Dockerfile13
1 files changed, 9 insertions, 4 deletions
diff --git a/gerrit/Dockerfile b/gerrit/Dockerfile
index 9edae12..98599f0 100644
--- a/gerrit/Dockerfile
+++ b/gerrit/Dockerfile
@@ -3,16 +3,21 @@ FROM gerritcodereview/gerrit
USER root
RUN yum -y install zip unzip patch
+# Patch LoginForm.html (unpack and repack from gerrit.war)
+ARG gerritwar="/var/gerrit/bin/gerrit.war"
+ARG libopenid="WEB-INF/lib/com_google_gerrit_httpd_auth_openid_libopenid.jar"
+ARG loginform="com/google/gerrit/httpd/auth/openid/LoginForm.html"
+
RUN \
- unzip /var/gerrit/bin/gerrit.war WEB-INF/lib/com_google_gerrit_httpd_auth_openid_libopenid.jar && \
- unzip WEB-INF/lib/com_google_gerrit_httpd_auth_openid_libopenid.jar com/google/gerrit/httpd/auth/openid/LoginForm.html
+ unzip "$gerritwar" "$libopenid" && \
+ unzip "$libopenid" "$loginform"
COPY add_osmocom.diff /tmp
RUN patch -p0 < /tmp/add_osmocom.diff
RUN \
- zip -u WEB-INF/lib/com_google_gerrit_httpd_auth_openid_libopenid.jar com/google/gerrit/httpd/auth/openid/LoginForm.html && \
- zip -u /var/gerrit/bin/gerrit.war WEB-INF/lib/com_google_gerrit_httpd_auth_openid_libopenid.jar
+ zip -u "$libopenid" "$loginform" && \
+ zip -u "$gerritwar" "$libopenid"
USER gerrit