|
3 | 3 |
|
4 | 4 | tasks: |
5 | 5 | - name: Clone the repository to a specific version (to a temp location) |
6 | | - git: |
| 6 | + ansible.builtin.git: |
7 | 7 | repo: "{{ repository_url }}" |
8 | 8 | dest: /tmp/src |
9 | | - accept_hostkey: yes |
| 9 | + accept_hostkey: true |
10 | 10 | version: "{{ app_version }}" |
11 | 11 |
|
12 | 12 | - name: Build with a given commit hash |
13 | 13 | # This will be stored in local registry, and available as version to docker-compose |
14 | 14 | # where we can just reference correct version |
15 | | - shell: "cd /tmp/src && make docker/build V={{ app_version }}" |
| 15 | + ansible.builtin.shell: "cd /tmp/src && make docker/build V={{ app_version }}" |
16 | 16 |
|
17 | 17 | - name: Create a server Makefile to manage app tasks |
18 | 18 | ansible.builtin.template: |
19 | | - src: ../templates/app/Makefile.app.j2 |
| 19 | + src: app/Makefile.app.j2 |
20 | 20 | dest: ./Makefile |
| 21 | + mode: "0644" |
21 | 22 |
|
22 | 23 | - name: Set up docker-compose.yml for the app |
23 | 24 | ansible.builtin.template: |
24 | | - src: ../templates/app/docker-compose.app.yml.j2 |
| 25 | + src: app/docker-compose.app.yml.j2 |
25 | 26 | dest: ./docker-compose.yml |
| 27 | + mode: "0644" |
26 | 28 |
|
27 | 29 | - name: Check if the env file exists |
28 | 30 | ansible.builtin.stat: |
|
31 | 33 |
|
32 | 34 | - name: If env file doesn't exist - copy the example |
33 | 35 | ansible.builtin.copy: |
34 | | - src: ../templates/app/intbot.env.example |
| 36 | + src: app/intbot.env.example |
35 | 37 | dest: intbot.env.example |
| 38 | + mode: "0644" |
36 | 39 | when: not env_file.stat.exists |
37 | 40 |
|
38 | 41 | - name: If the env file doesn't exist - fail with error message |
|
41 | 44 | when: not env_file.stat.exists |
42 | 45 |
|
43 | 46 | - name: Start docker compose to see if everything is running |
44 | | - shell: "docker compose up -d" |
| 47 | + ansible.builtin.shell: "docker compose up -d" |
45 | 48 |
|
46 | 49 | - name: Migrate on prod |
47 | | - shell: "make prod/migrate" |
| 50 | + ansible.builtin.shell: "make prod/migrate" |
48 | 51 |
|
49 | 52 | - name: Restart everything and finish |
50 | | - shell: "docker compose up -d" |
| 53 | + ansible.builtin.shell: "docker compose up -d" |
0 commit comments