Merge "Add an use a utility service for gerrit commands"

This commit is contained in:
Zuul 2020-03-20 16:51:50 +00:00 committed by Gerrit Code Review
commit f214917274
2 changed files with 16 additions and 9 deletions

View File

@ -1,14 +1,10 @@
# TODO(mordred) Make this suck less, like if we could do an init container
# or something just generally less gross.
- name: Run gerrit init
shell:
cmd: >
docker-compose run shell
java -jar /var/gerrit/bin/gerrit.war init -d /var/gerrit -b --no-auto-start --install-all-plugins
chdir: /etc/gerrit-compose/
when: gerrit_run_init | bool
command: >
docker run --rm --net=host -u gerrit
{% 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 docker-compose up
shell:

View File

@ -8,4 +8,15 @@ services:
volumes:
{% for volume in gerrit_container_volumes %}
- {{ volume }}
{% endfor %}
# Utility "service" to allow us to run ad-hoc commands
shell:
image: {{ gerrit_container_image }}
restart: 'no'
command: /bin/true
network_mode: host
user: gerrit
volumes:
{% for volume in gerrit_container_volumes %}
- {{ volume }}
{% endfor %}