Skip to content

Commit 395c8ef

Browse files
artczcybit
andauthored
Apply suggestions from code review
Co-authored-by: Cyril Bitterich <cebit-github@gunnet.de>
1 parent 01c74c0 commit 395c8ef

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

deploy/playbooks/02_nginx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
ansible.builtin.template:
1313
src: nginx/Makefile.nginx.j2
1414
dest: ./Makefile
15-
mode: "0644"
15+
mode: "0640"
1616

1717
- name: Set up docker-compose.yml on the remote server
1818
ansible.builtin.template:
1919
src: nginx/docker-compose.nginx.yml.j2
2020
dest: ./docker-compose.yml
21-
mode: "0644"
21+
mode: "0640"
2222

2323
- name: Make sure the directory structure for certs exist
2424
ansible.builtin.file:

deploy/playbooks/03_app.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
- name: Build with a given commit hash
1313
# This will be stored in local registry, and available as version to docker-compose
1414
# where we can just reference correct version
15-
ansible.builtin.shell: "cd /tmp/src && make docker/build V={{ app_version }}"
15+
ansible.builtin.shell:
16+
chdir: /tmp/src
17+
cmd: "/usr/bin/make docker/build V={{ app_version }}"
1618

1719
- name: Create a server Makefile to manage app tasks
1820
ansible.builtin.template:
@@ -24,7 +26,7 @@
2426
ansible.builtin.template:
2527
src: app/docker-compose.app.yml.j2
2628
dest: ./docker-compose.yml
27-
mode: "0644"
29+
mode: "0640"
2830

2931
- name: Check if the env file exists
3032
ansible.builtin.stat:
@@ -44,10 +46,16 @@
4446
when: not env_file.stat.exists
4547

4648
- name: Start docker compose to see if everything is running
47-
ansible.builtin.shell: "docker compose up -d"
49+
ansible.builtin.command:
50+
chdir: {{ ansible_user_dir }}
51+
cmd: "docker compose up -d"
4852

4953
- name: Migrate on prod
50-
ansible.builtin.shell: "make prod/migrate"
54+
ansible.builtin.shell:
55+
chdir: /tmp/src
56+
cmd: "/usr/bin/make prod/migrate"
5157

5258
- name: Restart everything and finish
53-
ansible.builtin.shell: "docker compose up -d"
59+
ansible.builtin.command:
60+
chdir: {{ ansible_user_dir }}
61+
cmd: "docker compose up -d"

0 commit comments

Comments
 (0)