diff --git a/roles/_init/tasks/main.yml b/roles/_init/tasks/main.yml index 3b04b4ec..9f109361 100644 --- a/roles/_init/tasks/main.yml +++ b/roles/_init/tasks/main.yml @@ -53,9 +53,9 @@ ansible.builtin.set_fact: live_symlink_build_dest: "{{ live_symlink_build_dest | default('{{ build_base_path }}/live.{{ project_name }}_{{ build_type }}') }}" - - name: Stash current deploy path for later use where we need to manipulate the live site. + - name: Set the previous deploy's path for later use where we need to manipulate the live site. ansible.builtin.set_fact: - initial_deploy_path: "{{ deploy_path }}" + previous_deploy_path: "{{ initial_deploy_path | default('{{ deploy_path_prefix }}{{ previous_build_number }}') }}" - name: Overwrite deploy and live_symlink paths if SquashFS deploy. ansible.builtin.set_fact: diff --git a/roles/maintenance_mode/maintenance_mode-drupal-core/tasks/online.yml b/roles/maintenance_mode/maintenance_mode-drupal-core/tasks/online.yml index ab548596..0f420c8d 100644 --- a/roles/maintenance_mode/maintenance_mode-drupal-core/tasks/online.yml +++ b/roles/maintenance_mode/maintenance_mode-drupal-core/tasks/online.yml @@ -12,9 +12,9 @@ # We want to also bring up the 'current' site with squashfs builds - name: Disable live site maintenance mode if this is a squashfs build. ansible.builtin.command: - cmd: "{{ drush_bin }} -l {{ site.folder }} state:set system.maintenance_mode 0 --input-format=integer --root {{ initial_deploy_path }}/{{ webroot }}/sites/{{ site.folder }}" + cmd: "{{ drush_bin }} -l {{ site.folder }} state:set system.maintenance_mode 0 --input-format=integer --root {{ previous_deploy_path }}/{{ webroot }}/sites/{{ site.folder }}" args: - chdir: "{{ initial_deploy_path }}/{{ webroot }}/sites/{{ site.folder }}" + chdir: "{{ previous_deploy_path }}/{{ webroot }}/sites/{{ site.folder }}" become: "{{ 'no' if www_user == deploy_user else 'yes' }}" become_user: "{{ www_user }}" when: @@ -36,7 +36,7 @@ - name: Disable maintenance mode D7 if this is a squashfs build. ansible.builtin.shell: cmd: "{{ drush_bin }} -l {{ site.folder }} vset maintenance_mode 0" - chdir: "{{ initial_deploy_path }}/{{ webroot }}/sites/{{ site.folder }}" + chdir: "{{ previous_deploy_path }}/{{ webroot }}/sites/{{ site.folder }}" become: "{{ 'no' if www_user == deploy_user else 'yes' }}" become_user: "{{ www_user }}" when: