Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit e3e9bf8

Browse files
committed
Explicitly casting integers as strings for path creation.
1 parent 0a0f3f8 commit e3e9bf8

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

roles/_init/tasks/main.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,19 @@
3030
ansible.builtin.set_fact:
3131
deploy_user: "{{ deploy_user | default('deploy') }}"
3232

33-
- name: Define deploy base path.
33+
- name: Define deploy paths.
3434
ansible.builtin.set_fact:
3535
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:
3936
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:
4337
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) }}"
4440

4541
# This is passed from caller.
4642
- name: Gather last known good build number.
4743
ansible.builtin.set_fact:
4844
previous_build_number: "{{ previous_known_build_number }}"
4945

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-
5846
- name: Define live_symlink dest.
5947
ansible.builtin.set_fact:
6048
live_symlink_dest: "{{ live_symlink_dest | default(deploy_base_path + '/live.' + project_name + '_' + build_type) }}"
@@ -85,7 +73,7 @@
8573
msg: "Track file ID: {{ previous_build_number }}. Build path ID: {{ _current_build_id }}. These should match, something is wrong, failing the build."
8674
when:
8775
- _current_build_path.stat.islnk
88-
- _current_build_id | int != previous_build_number | int
76+
- _current_build_id|int != previous_build_number|int
8977
- not skip_build_path_check
9078

9179
- name: Define opcache cachetool path.
@@ -118,7 +106,7 @@
118106

119107
- name: Overwrite deploy and live_symlink paths if SquashFS deploy.
120108
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) }}"
122110

123111
- name: Overwrite cachetool path if SquashFS deploy and path not provided.
124112
ansible.builtin.set_fact:
@@ -206,7 +194,7 @@
206194

207195
- name: Set the previous deploy's path for later use where we need to manipulate the live site.
208196
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) }}"
210198

211199
# Make sure the deploy target exists.
212200
- name: Ensure deploy target directory exists.

0 commit comments

Comments
 (0)