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

View File

@ -3,3 +3,14 @@ gerrit_user_name: gerrit2
gerrit_home_dir: /home/gerrit2 gerrit_home_dir: /home/gerrit2
gerrit_site_dir: "{{ gerrit_home_dir }}/review_site" gerrit_site_dir: "{{ gerrit_home_dir }}/review_site"
gerrit_run_init: false 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 dest: /opt/project-config
force: yes force: yes
- name: Synchronize podman-compose directory - name: Ensure /etc/gerrit-compose directory
synchronize: file:
src: gerrit-podman/ state: directory
dest: /etc/gerrit-podman/ 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 - name: Create Gerrit Group
group: group:
@ -180,18 +192,13 @@
when: gerrit_run_init | bool when: gerrit_run_init | bool
command: > command: >
podman run -it --rm --net=host -u gerrit podman run -it --rm --net=host -u gerrit
-v /home/gerrit2/review_site/cache:/var/gerrit/cache {% for volume in gerrit_container_volumes %}
-v /home/gerrit2/review_site/etc:/var/gerrit/etc -v {{ volume }}
-v /home/gerrit2/review_site/git:/var/gerrit/git {% endfor %}
-v /home/gerrit2/review_site/tmp:/var/gerrit/tmp {{ gerrit_container_image }}
-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
/usr/local/openjdk-8/bin/java -jar /var/gerrit/bin/gerrit.war init -d /var/gerrit -b --no-auto-start --install-all-plugins /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 - name: Run podman-compose up
shell: shell:
cmd: podman-compose up -d 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 %}