Merge "Restart gitea more cleaner"
This commit is contained in:
commit
3709d0a39b
@ -34,13 +34,42 @@
|
|||||||
shell:
|
shell:
|
||||||
cmd: docker-compose pull
|
cmd: docker-compose pull
|
||||||
chdir: /etc/gitea-docker/
|
chdir: /etc/gitea-docker/
|
||||||
- name: Run docker-compose up
|
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:
|
shell:
|
||||||
cmd: docker-compose up -d --timeout 60
|
cmd: docker-compose stop --timeout 60
|
||||||
chdir: /etc/gitea-docker/
|
chdir: /etc/gitea-docker/
|
||||||
- name: Run docker prune to cleanup unneeded images
|
- 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:
|
shell:
|
||||||
cmd: docker image prune -f
|
cmd: docker image prune -f
|
||||||
|
|
||||||
|
# User management outside of service bringup to avoid confusion between
|
||||||
|
# the two stages.
|
||||||
- name: Check if root user exists
|
- name: Check if root user exists
|
||||||
uri:
|
uri:
|
||||||
url: "https://localhost:3000/api/v1/users/root"
|
url: "https://localhost:3000/api/v1/users/root"
|
||||||
|
@ -35,6 +35,7 @@ services:
|
|||||||
gitea-ssh:
|
gitea-ssh:
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
- mariadb
|
||||||
|
- gitea-web
|
||||||
environment:
|
environment:
|
||||||
- SSH_LISTEN_PORT=222
|
- SSH_LISTEN_PORT=222
|
||||||
image: docker.io/opendevorg/gitea-openssh
|
image: docker.io/opendevorg/gitea-openssh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user