|
1 | 1 | --- |
2 | | -- include_tasks: "{{ ansistrano_before_setup_tasks_file | default('empty.yml') }}" |
| 2 | +- name: ANSISTRANO | Mark release as not activated |
| 3 | + set_fact: |
| 4 | + ansistrano_release_activated: false |
3 | 5 |
|
4 | | -- include_tasks: setup.yml |
| 6 | +- block: |
| 7 | + - include_tasks: "{{ ansistrano_before_setup_tasks_file | default('empty.yml') }}" |
5 | 8 |
|
6 | | -- include_tasks: "{{ ansistrano_after_setup_tasks_file | default('empty.yml') }}" |
| 9 | + - include_tasks: setup.yml |
7 | 10 |
|
8 | | -- include_tasks: "{{ ansistrano_before_update_code_tasks_file | default('empty.yml') }}" |
| 11 | + - include_tasks: "{{ ansistrano_after_setup_tasks_file | default('empty.yml') }}" |
9 | 12 |
|
10 | | -- include_tasks: update-code.yml |
| 13 | + - include_tasks: "{{ ansistrano_before_update_code_tasks_file | default('empty.yml') }}" |
11 | 14 |
|
12 | | -- include_tasks: "{{ ansistrano_after_update_code_tasks_file | default('empty.yml') }}" |
| 15 | + - include_tasks: update-code.yml |
13 | 16 |
|
14 | | -- include_tasks: "{{ ansistrano_before_symlink_shared_tasks_file | default('empty.yml') }}" |
| 17 | + - include_tasks: "{{ ansistrano_after_update_code_tasks_file | default('empty.yml') }}" |
15 | 18 |
|
16 | | -- include_tasks: symlink-shared.yml |
| 19 | + - include_tasks: "{{ ansistrano_before_symlink_shared_tasks_file | default('empty.yml') }}" |
17 | 20 |
|
18 | | -- include_tasks: "{{ ansistrano_after_symlink_shared_tasks_file | default('empty.yml') }}" |
| 21 | + - include_tasks: symlink-shared.yml |
19 | 22 |
|
20 | | -- include_tasks: "{{ ansistrano_before_symlink_tasks_file | default('empty.yml') }}" |
| 23 | + - include_tasks: "{{ ansistrano_after_symlink_shared_tasks_file | default('empty.yml') }}" |
21 | 24 |
|
22 | | -- include_tasks: symlink.yml |
23 | | - when: ansistrano_current_via == "symlink" |
| 25 | + - include_tasks: "{{ ansistrano_before_symlink_tasks_file | default('empty.yml') }}" |
24 | 26 |
|
25 | | -- include_tasks: rsync-deploy.yml |
26 | | - when: ansistrano_current_via == "rsync" |
| 27 | + - include_tasks: symlink.yml |
| 28 | + when: ansistrano_current_via == "symlink" |
27 | 29 |
|
28 | | -- include_tasks: "{{ ansistrano_after_symlink_tasks_file | default('empty.yml') }}" |
| 30 | + - include_tasks: rsync-deploy.yml |
| 31 | + when: ansistrano_current_via == "rsync" |
29 | 32 |
|
30 | | -- include_tasks: "{{ ansistrano_before_cleanup_tasks_file | default('empty.yml') }}" |
| 33 | + - name: ANSISTRANO | Mark release as activated |
| 34 | + set_fact: |
| 35 | + ansistrano_release_activated: true |
31 | 36 |
|
32 | | -- include_tasks: cleanup.yml |
| 37 | + - include_tasks: "{{ ansistrano_after_symlink_tasks_file | default('empty.yml') }}" |
33 | 38 |
|
34 | | -- include_tasks: "{{ ansistrano_after_cleanup_tasks_file | default('empty.yml') }}" |
| 39 | + - include_tasks: "{{ ansistrano_before_cleanup_tasks_file | default('empty.yml') }}" |
35 | 40 |
|
36 | | -- include_tasks: anon-stats.yml |
| 41 | + - include_tasks: cleanup.yml |
37 | 42 |
|
38 | | -- include_tasks: funding.yml |
| 43 | + - include_tasks: "{{ ansistrano_after_cleanup_tasks_file | default('empty.yml') }}" |
| 44 | + |
| 45 | + - include_tasks: anon-stats.yml |
| 46 | + |
| 47 | + - include_tasks: funding.yml |
| 48 | + rescue: |
| 49 | + - name: ANSISTRANO | Remove failed release |
| 50 | + file: |
| 51 | + path: "{{ ansistrano_release_path.stdout }}" |
| 52 | + state: absent |
| 53 | + when: |
| 54 | + - ansistrano_release_path is defined |
| 55 | + - ansistrano_release_path.stdout is defined |
| 56 | + - not ansistrano_release_activated |
| 57 | + |
| 58 | + - fail: |
| 59 | + msg: >- |
| 60 | + Deployment failed in task |
| 61 | + {{ ansible_failed_task.name | default('unknown task') }}: |
| 62 | + {{ ansible_failed_result.msg | default(ansible_failed_result | string) }} |
0 commit comments