Ansible: Re-organise deployment steps
This commit is contained in:
parent
b83baa4c26
commit
e874475c32
|
@ -9,26 +9,28 @@
|
|||
include_role:
|
||||
name: opdavies.drupal_settings_files
|
||||
|
||||
- name: Clear Drush cache
|
||||
command: >
|
||||
{{ release_drush_path }}
|
||||
cache-clear drush
|
||||
chdir={{ release_web_path }}
|
||||
changed_when: false
|
||||
|
||||
- name: Run database updates
|
||||
command: '{{ release_drush_path }} updatedb -y'
|
||||
args:
|
||||
chdir: '{{ release_web_path }}'
|
||||
command: >
|
||||
{{ release_drush_path }}
|
||||
updatedb -y
|
||||
chdir={{ release_web_path }}
|
||||
register: update_database_result
|
||||
changed_when: "'No pending updates' not in update_database_result.stderr"
|
||||
|
||||
- name: Import configuration
|
||||
command: '{{ release_drush_path }} config-import -y'
|
||||
args:
|
||||
chdir: '{{ release_web_path }}'
|
||||
command: >
|
||||
{{ release_drush_path }} config-import -y
|
||||
chdir={{ release_web_path }}
|
||||
register: config_import_result
|
||||
changed_when: "'There are no changes to import' not in config_import_result.stderr"
|
||||
|
||||
- name: Rebuild cache
|
||||
command: '{{ release_drush_path }} cache-rebuild'
|
||||
args:
|
||||
chdir: '{{ release_web_path }}'
|
||||
changed_when: false
|
||||
|
||||
- name: Generate front-end assets
|
||||
command: |
|
||||
{{ item.command }}
|
||||
|
@ -51,9 +53,3 @@
|
|||
with_items:
|
||||
- body-field-values.txt
|
||||
- node_modules
|
||||
|
||||
- name: Rebuild cache again
|
||||
command: '{{ release_drush_path }} cache-rebuild'
|
||||
args:
|
||||
chdir: '{{ release_web_path }}'
|
||||
changed_when: false
|
||||
|
|
6
tools/ansible/deploy/before-symlink.yml
Normal file
6
tools/ansible/deploy/before-symlink.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: Rebuild Drupal cache
|
||||
command: >
|
||||
{{ release_drush_path }} cache-rebuild
|
||||
chdir={{ release_web_path }}
|
||||
changed_when: false
|
|
@ -11,6 +11,7 @@ ansistrano_shared_paths:
|
|||
# Hooks
|
||||
ansistrano_after_symlink_shared_tasks_file: '{{ playbook_dir }}/deploy/after-symlink-shared.yml'
|
||||
ansistrano_after_update_code_tasks_file: '{{ playbook_dir }}/deploy/after-update-code.yml'
|
||||
ansistrano_before_symlink_tasks_file: '{{ playbook_dir }}/deploy/before-symlink.yml'
|
||||
|
||||
app_hash_salt: '{{ vault_app_hash_salt }}'
|
||||
|
||||
|
|
Loading…
Reference in a new issue