Merge "Restart gitea more cleaner"

This commit is contained in:
Zuul 2020-03-18 23:56:10 +00:00 committed by Gerrit Code Review
commit 3709d0a39b
2 changed files with 37 additions and 7 deletions

View File

@ -34,13 +34,42 @@
shell:
cmd: docker-compose pull
chdir: /etc/gitea-docker/
- name: Run docker-compose up
shell:
cmd: docker-compose up -d --timeout 60
chdir: /etc/gitea-docker/
- name: Run docker prune to cleanup unneeded images
shell:
cmd: docker image prune -f
register: docker_compose_pull
- name: Stop/Start gitea safely for Gerrit replication
when: "'Downloaded newer image' in docker_compose_pull.stdout"
block:
- name: Run docker-compose stop
shell:
cmd: docker-compose stop --timeout 60
chdir: /etc/gitea-docker/
- name: Run docker-compose up mariadb gitea-web
shell:
cmd: docker-compose up -d --timeout 60 mariadb gitea-web
chdir: /etc/gitea-docker/
# We wait here for the main gitea service to start before starting
# the ssh service. This is friendly to gerrit replication.
- name: Wait until the web service is sufficiently up to start ssh
uri:
url: "https://localhost:3000/api/v1/users/root"
validate_certs: false
status_code: 200, 404
register: root_user_check
delay: 1
retries: 300
until: root_user_check and root_user_check.status in (200, 404)
- name: Run docker-compose up gitea-ssh
shell:
cmd: docker-compose up -d --timeout 60 gitea-ssh
chdir: /etc/gitea-docker/
- name: Run docker prune to cleanup unneeded images
shell:
cmd: docker image prune -f
# User management outside of service bringup to avoid confusion between
# the two stages.
- name: Check if root user exists
uri:
url: "https://localhost:3000/api/v1/users/root"

View File

@ -35,6 +35,7 @@ services:
gitea-ssh:
depends_on:
- mariadb
- gitea-web
environment:
- SSH_LISTEN_PORT=222
image: docker.io/opendevorg/gitea-openssh