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

Commit c76f38d

Browse files
gregharveydrazenCEfiliprupicfiliptymofiisobchenko
authored
Ansible12 fixes pr devel 1.x (#765)
* Php unix socket pr 1.x (#724) * Moving cachetool adapter setup to the installer role and adding a test. * Updating cachetool documentation. * Php unix socket pr 1.x (#726) * Moving cachetool adapter setup to the installer role and adding a test. * Updating cachetool documentation. * Making sure _cachetool_adapter is always set. * Optional-drush-cr-before-import (#728) * 73171 fixing cachetool checks fpm pr 1.x (#729) * skipping cachetool check when no fpm * remove empty line --------- Co-authored-by: filip <filip.rupic@codeenigma.com> * asg_management_fix_and_improve (#733) * asg_management_fix_and_improve * asg_management_fix_and_improve * asg_management_fix_and_improve * asg_management_fix_and_improve * asg_management_fix_and_improve * Adding-delay-opcache-status-check (#737) * Adding-delay-opcache-status-check * Removing-failed-when * fix_var_name_for_asg_management (#739) * replace_ansible_pause_module (#747) * fix_asg_management_workaround_for_squashfs (#754) * fix_asg_management_workaround_for_squashfs * fix_asg_management_workaround_for_squashfs * fix_asg_management_workaround_task_condition (#756) * aws_profile_for_asg_management (#758) * aws_profile_for_asg_management * aws_profile_for_asg_management_case_with_default_profile_absent * ansible_module_requires_too_much_perms_just_for_autoscaling_managemen… (#761) * ansible_module_requires_too_much_perms_just_for_autoscaling_management_so_replacing_with_aws_cli_from_role * fix condition * asg_management_workaround_improve_fix_conditions * remove extra line * Updating 'default()' filter paths in _init as an initial test. * Explicitly casting integers as strings for path creation. * Over refactored the variable setting! --------- Co-authored-by: drazenCE <140631110+drazenCE@users.noreply.github.com> Co-authored-by: Filip Rupic <123341158+filiprupic@users.noreply.github.com> Co-authored-by: filip <filip.rupic@codeenigma.com> Co-authored-by: tymofiisobchenko <104431720+tymofiisobchenko@users.noreply.github.com>
1 parent f98ea7b commit c76f38d

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

roles/_init/tasks/drupal8.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
- name: Define path to drush for this build.
33
ansible.builtin.set_fact:
4-
drush_bin: "{{ drush_bin | default('{{ deploy_path }}/vendor/bin/drush') }}"
4+
drush_bin: "{{ drush_bin | default(deploy_path + '/vendor/bin/drush') }}"
55

66
- name: Define path to drush for previous build.
77
ansible.builtin.set_fact:
8-
previous_drush_bin: "{{ previous_drush_bin | default('{{ previous_deploy_path }}/vendor/bin/drush') }}"
8+
previous_drush_bin: "{{ previous_drush_bin | default(previous_deploy_path + '/vendor/bin/drush') }}"
99

1010
- name: Define path to drush for currently live build.
1111
ansible.builtin.set_fact:
12-
drush_live_bin: "{{ drush_live_bin | default('{{ live_symlink_dest }}/vendor/bin/drush') }}"
12+
drush_live_bin: "{{ drush_live_bin | default(live_symlink_dest + '/vendor/bin/drush') }}"
1313

1414
- name: Ensure we have a cachetool binary and configuration.
1515
ansible.builtin.import_role:

roles/_init/tasks/main.yml

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

33-
- name: Define deploy base path.
33+
- name: Define initial deploy paths.
3434
ansible.builtin.set_fact:
35-
deploy_base_path: "{{ deploy_base_path | default('/home/{{ deploy_user }}/deploy/{{ project_name }}_{{ build_type }}') }}"
35+
deploy_base_path: "{{ deploy_base_path | default('/home/' + deploy_user + '/deploy/' + project_name + '_' + build_type) }}"
36+
deploy_assets_base_path: "{{ deploy_assets_base_path | default('/home/' + deploy_user + '/shared/' + project_name + '_' + build_type + '/assets') }}"
37+
webroot: "{{ webroot | default('web') }}"
3638

37-
- name: Define mounted directory for assets.
39+
- name: Define deploy_path_prefix variable.
3840
ansible.builtin.set_fact:
39-
deploy_assets_base_path: "{{ deploy_assets_base_path | default('/home/{{ deploy_user }}/shared/{{ project_name }}_{{ build_type }}/assets') }}"
41+
deploy_path_prefix: "{{ deploy_base_path }}/{{ project_name }}_{{ build_type }}_build_"
4042

41-
- name: Define webroot.
43+
- name: Define final deploy_path variable.
4244
ansible.builtin.set_fact:
43-
webroot: "{{ webroot | default('web') }}"
45+
deploy_path: "{{ deploy_path | default(deploy_path_prefix + build_number|string) }}"
4446

4547
# This is passed from caller.
4648
- name: Gather last known good build number.
4749
ansible.builtin.set_fact:
4850
previous_build_number: "{{ previous_known_build_number }}"
4951

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-
5852
- name: Define live_symlink dest.
5953
ansible.builtin.set_fact:
60-
live_symlink_dest: "{{ live_symlink_dest | default('{{ deploy_base_path }}/live.{{ project_name }}_{{ build_type }}') }}"
54+
live_symlink_dest: "{{ live_symlink_dest | default(deploy_base_path + '/live.' + project_name + '_' + build_type) }}"
6155

6256
- name: Read the live symlink to get the path to the current build.
6357
ansible.builtin.stat:
@@ -85,7 +79,7 @@
8579
msg: "Track file ID: {{ previous_build_number }}. Build path ID: {{ _current_build_id }}. These should match, something is wrong, failing the build."
8680
when:
8781
- _current_build_path.stat.islnk
88-
- _current_build_id | int != previous_build_number | int
82+
- _current_build_id|int != previous_build_number|int
8983
- not skip_build_path_check
9084

9185
- name: Define opcache cachetool path.
@@ -114,11 +108,11 @@
114108

115109
- name: Define live_symlink dest for image builds.
116110
ansible.builtin.set_fact:
117-
live_symlink_build_dest: "{{ live_symlink_build_dest | default('{{ build_base_path }}/live.{{ project_name }}_{{ build_type }}') }}"
111+
live_symlink_build_dest: "{{ live_symlink_build_dest | default(build_base_path + '/live.' + project_name + '_' + build_type) }}"
118112

119113
- name: Overwrite deploy and live_symlink paths if SquashFS deploy.
120114
ansible.builtin.set_fact:
121-
deploy_path: "{{ build_path | default('{{ build_path_prefix }}{{ build_number }}') }}"
115+
deploy_path: "{{ build_path | default(build_path_prefix + build_number|string) }}"
122116

123117
- name: Overwrite cachetool path if SquashFS deploy and path not provided.
124118
ansible.builtin.set_fact:
@@ -206,7 +200,7 @@
206200

207201
- name: Set the previous deploy's path for later use where we need to manipulate the live site.
208202
ansible.builtin.set_fact:
209-
previous_deploy_path: "{{ previous_deploy_path | default('{{ deploy_path_prefix }}{{ previous_build_number }}') }}"
203+
previous_deploy_path: "{{ previous_deploy_path | default(deploy_path_prefix + previous_build_number|string) }}"
210204

211205
# Make sure the deploy target exists.
212206
- name: Ensure deploy target directory exists.

0 commit comments

Comments
 (0)