Merge "gerrit: copy static files directly into container image"

This commit is contained in:
Zuul 2021-09-27 16:54:16 +00:00 committed by Gerrit Code Review
commit 64d0939da2
8 changed files with 21 additions and 21 deletions

View File

@ -22,6 +22,7 @@ RUN mkdir /var/gerrit/plugins && \
unzip -jo /var/gerrit/bin/gerrit.war WEB-INF/plugins/* -d /var/gerrit/plugins
# NOTE(ianw) : copied into build context by playbooks/zuul/gerrit/run.yaml
COPY opendevtheme.html /var/gerrit/plugins/opendevtheme.html
COPY plugins/opendevtheme.html /var/gerrit/plugins/opendevtheme.html
COPY static/ /var/gerrit/
COPY bazel-bin/plugins/zuul-results-summary/zuul-results-summary.jar /var/gerrit/plugins/zuul-results-summary.jar

View File

@ -17,7 +17,6 @@ gerrit_container_volumes:
- /home/gerrit2/review_site/hooks:/var/gerrit/hooks
- /home/gerrit2/review_site/index:/var/gerrit/index
- /home/gerrit2/review_site/logs:/var/log/gerrit
- /home/gerrit2/review_site/static:/var/gerrit/static
- /home/gerrit2/review_site/tmp:/var/gerrit/tmp
- /opt/project-config/gerrit/projects.yaml:/var/gerrit/etc/projects.yaml
- /opt/project-config/gerrit/projects.ini:/var/gerrit/etc/projects.ini

View File

@ -59,7 +59,6 @@
- hooks
- index
- logs
- static
- tmp
- name: Write Gerrit config file
@ -207,20 +206,6 @@
- change-abandoned
- patchset-created
# TODO(mordred) These things should really go into the image instead.
- name: Copy static and etc
copy:
src: "{{ item }}"
dest: "{{ gerrit_site_dir }}/{{ item }}"
owner: "{{ gerrit_user_name }}"
group: "{{ gerrit_user_name }}"
mode: preserve
loop:
- static/cla.html
- static/robots.txt
- static/system-cla.html
- static/usg-cla.html
- name: Write manage-projects script
template:
src: "manage-projects.j2"

View File

@ -34,10 +34,25 @@
mv $target bazel-bin
chdir: /home/zuul/src/gerrit.googlesource.com/gerrit
- name: Install OpenDev theme plugin
copy:
src: plugins/opendevtheme.html
dest: /home/zuul/src/gerrit.googlesource.com/gerrit/opendevtheme.html
- 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/robots.txt
- static/system-cla.html
- static/usg-cla.html
- plugins/opendevtheme.html
- name: Build docker image
include_role: