|
30 | 30 | ansible.builtin.set_fact: |
31 | 31 | deploy_user: "{{ deploy_user | default('deploy') }}" |
32 | 32 |
|
33 | | -- name: Define deploy base path. |
| 33 | +- name: Define deploy paths. |
34 | 34 | ansible.builtin.set_fact: |
35 | 35 | deploy_base_path: "{{ deploy_base_path | default('/home/' + deploy_user + '/deploy/' + project_name + '_' + build_type) }}" |
36 | | - |
37 | | -- name: Define mounted directory for assets. |
38 | | - ansible.builtin.set_fact: |
39 | 36 | deploy_assets_base_path: "{{ deploy_assets_base_path | default('/home/' + deploy_user + '/shared/' + project_name + '_' + build_type + '/assets') }}" |
40 | | - |
41 | | -- name: Define webroot. |
42 | | - ansible.builtin.set_fact: |
43 | 37 | webroot: "{{ webroot | default('web') }}" |
| 38 | + deploy_path_prefix: "{{ deploy_base_path }}/{{ project_name }}_{{ build_type }}_build_" |
| 39 | + deploy_path: "{{ deploy_path | default(deploy_path_prefix + build_number|string) }}" |
44 | 40 |
|
45 | 41 | # This is passed from caller. |
46 | 42 | - name: Gather last known good build number. |
47 | 43 | ansible.builtin.set_fact: |
48 | 44 | previous_build_number: "{{ previous_known_build_number }}" |
49 | 45 |
|
50 | | -- name: Define build deploy path prefix. |
51 | | - ansible.builtin.set_fact: |
52 | | - deploy_path_prefix: "{{ deploy_base_path }}/{{ project_name }}_{{ build_type }}_build_" |
53 | | - |
54 | | -- name: Define build deploy path. |
55 | | - ansible.builtin.set_fact: |
56 | | - deploy_path: "{{ deploy_path | default(deploy_path_prefix + build_number) }}" |
57 | | - |
58 | 46 | - name: Define live_symlink dest. |
59 | 47 | ansible.builtin.set_fact: |
60 | 48 | live_symlink_dest: "{{ live_symlink_dest | default(deploy_base_path + '/live.' + project_name + '_' + build_type) }}" |
|
85 | 73 | msg: "Track file ID: {{ previous_build_number }}. Build path ID: {{ _current_build_id }}. These should match, something is wrong, failing the build." |
86 | 74 | when: |
87 | 75 | - _current_build_path.stat.islnk |
88 | | - - _current_build_id | int != previous_build_number | int |
| 76 | + - _current_build_id|int != previous_build_number|int |
89 | 77 | - not skip_build_path_check |
90 | 78 |
|
91 | 79 | - name: Define opcache cachetool path. |
|
118 | 106 |
|
119 | 107 | - name: Overwrite deploy and live_symlink paths if SquashFS deploy. |
120 | 108 | ansible.builtin.set_fact: |
121 | | - deploy_path: "{{ build_path | default(build_path_prefix + build_number) }}" |
| 109 | + deploy_path: "{{ build_path | default(build_path_prefix + build_number|string) }}" |
122 | 110 |
|
123 | 111 | - name: Overwrite cachetool path if SquashFS deploy and path not provided. |
124 | 112 | ansible.builtin.set_fact: |
|
206 | 194 |
|
207 | 195 | - name: Set the previous deploy's path for later use where we need to manipulate the live site. |
208 | 196 | ansible.builtin.set_fact: |
209 | | - previous_deploy_path: "{{ previous_deploy_path | default(deploy_path_prefix + previous_build_number) }}" |
| 197 | + previous_deploy_path: "{{ previous_deploy_path | default(deploy_path_prefix + previous_build_number|string) }}" |
210 | 198 |
|
211 | 199 | # Make sure the deploy target exists. |
212 | 200 | - name: Ensure deploy target directory exists. |
|
0 commit comments