-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yml
40 lines (35 loc) · 1007 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
- hosts: all
remote_user: root
become: yes
become_method: sudo
vars:
compose_directory: /data/blockexchange.minetest.ch
tasks:
- name: Copy config files
template:
src: "{{item}}"
dest: "{{compose_directory}}/{{item}}"
with_items:
- "docker-compose.yml"
- "blockexchange.env"
- "haproxy.cfg"
- name: Pull latest images
shell:
cmd: "docker-compose pull"
chdir: "{{ compose_directory }}"
- name: Update active deployment
shell:
cmd: "docker-compose up -d blockexchange_active"
chdir: "{{ compose_directory }}"
- name: Wait for container start
pause:
seconds: 10
- name: Update passive deployment
shell:
cmd: "docker-compose up -d blockexchange_passive"
chdir: "{{ compose_directory }}"
- name: Start auxilliary services
shell:
cmd: "docker-compose up -d --remove-orphans"
chdir: "{{ compose_directory }}"