Clean up review comments

Make image and volume list in compose file templated.

Rename the gerrit-podman directory to not be based on tool.

Make sure we run the job on changes to the playbooks.

Update the job name - it's not just review-dev anymore.

Change-Id: I0341fa95caff656a2176cc2026ec0ac8903fb24e
This commit is contained in:
Monty Taylor 2019-10-30 08:37:55 +09:00
parent e42862af73
commit a3d91d4df3
5 changed files with 47 additions and 34 deletions

View File

@ -1012,7 +1012,7 @@
- testinfra/test_zuul_preview.py
- job:
name: system-config-run-review-dev
name: system-config-run-review
parent: system-config-run
description: |
Run the playbook for gerrit (in a container).
@ -1042,6 +1042,7 @@
- ^playbooks/host_vars/review\d+.opendev.org.yaml
- playbooks/group_vars/review-dev.yaml
- ^playbooks/host_vars/review-dev\d+.opendev.org.yaml
- ^playbooks/service-review.*.yaml
- playbooks/zuul/templates/group_vars/review-dev.yaml.j2
- playbooks/zuul/templates/group_vars/review.yaml.j2
- playbooks/roles/gerrit/
@ -1104,7 +1105,7 @@
soft: true
- name: system-config-build-image-haproxy-statsd
soft: true
- system-config-run-review-dev
- system-config-run-review
- system-config-run-zuul-preview
- system-config-run-letsencrypt
- system-config-build-image-bazel
@ -1164,7 +1165,7 @@
soft: true
- name: system-config-upload-image-haproxy-statsd
soft: true
- system-config-run-review-dev
- system-config-run-review
- system-config-run-zuul-preview
- system-config-run-letsencrypt
- system-config-upload-image-bazel

View File

@ -3,3 +3,14 @@ gerrit_user_name: gerrit2
gerrit_home_dir: /home/gerrit2
gerrit_site_dir: "{{ gerrit_home_dir }}/review_site"
gerrit_run_init: false
gerrit_container_image: docker.io/opendevorg/gerrit:2.13
gerrit_container_volumes:
- /home/gerrit2/review_site/cache:/var/gerrit/cache
- /home/gerrit2/review_site/etc:/var/gerrit/etc
- /home/gerrit2/review_site/git:/var/gerrit/git
- /home/gerrit2/review_site/tmp:/var/gerrit/tmp
- /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/.launchpadlib:/var/gerrit/.launchpadlib

View File

@ -1,17 +0,0 @@
version: '3'
services:
gerrit:
image: docker.io/opendevorg/gerrit:2.13
network_mode: host
user: gerrit
volumes:
- /home/gerrit2/review_site/cache:/var/gerrit/cache
- /home/gerrit2/review_site/etc:/var/gerrit/etc
- /home/gerrit2/review_site/git:/var/gerrit/git
- /home/gerrit2/review_site/tmp:/var/gerrit/tmp
- /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/.launchpadlib:/var/gerrit/.launchpadlib

View File

@ -9,10 +9,22 @@
dest: /opt/project-config
force: yes
- name: Synchronize podman-compose directory
synchronize:
src: gerrit-podman/
dest: /etc/gerrit-podman/
- name: Ensure /etc/gerrit-compose directory
file:
state: directory
path: /etc/gerrit-compose
mode: 0755
- name: Put docker-compose file in place
template:
src: docker-compose.yaml.j2
dest: /etc/gerrit-compose/docker-compose.yaml
mode: 0644
- name: Clean up old directory
file:
state: absent
path: /etc/gerrit-podman
- name: Create Gerrit Group
group:
@ -180,18 +192,13 @@
when: gerrit_run_init | bool
command: >
podman run -it --rm --net=host -u gerrit
-v /home/gerrit2/review_site/cache:/var/gerrit/cache
-v /home/gerrit2/review_site/etc:/var/gerrit/etc
-v /home/gerrit2/review_site/git:/var/gerrit/git
-v /home/gerrit2/review_site/tmp:/var/gerrit/tmp
-v /home/gerrit2/review_site/hooks:/var/gerrit/hooks
-v /home/gerrit2/review_site/index:/var/gerrit/index
-v /home/gerrit2/review_site/logs:/var/log/gerrit
-v /home/gerrit2/review_site/static:/var/gerrit/static
docker.io/opendevorg/gerrit:2.13
{% for volume in gerrit_container_volumes %}
-v {{ volume }}
{% endfor %}
{{ gerrit_container_image }}
/usr/local/openjdk-8/bin/java -jar /var/gerrit/bin/gerrit.war init -d /var/gerrit -b --no-auto-start --install-all-plugins
- name: Run podman-compose up
shell:
cmd: podman-compose up -d
chdir: /etc/gerrit-podman/
chdir: /etc/gerrit-compose/

View File

@ -0,0 +1,11 @@
version: '3'
services:
gerrit:
image: {{ gerrit_container_image }}
network_mode: host
user: gerrit
volumes:
{% for volume in gerrit_container_volumes %}
- {{ volume }}
{% endfor %}