--- - name: Install Composer dependencies composer: command: install optimize_autoloader: true working_dir: '{{ ansistrano_release_path.stdout }}' - name: Generate settings.php file include_role: name: opdavies.drupal_settings_files - name: Run database updates command: '{{ release_drush_path }} updatedb -y' args: 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 }}' 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 }} chdir={{ release_theme_path }} creates="{{ item.creates }}" with_items: - command: "{{ release_drush_path }} opdavies:export-body-values-for-theme-purging" creates: "{{ release_theme_path }}/body-field-values.txt" - command: npm install creates: "{{ release_theme_path }}/node_modules" - command: npm run production creates: "{{ release_theme_path }}/dist" - name: Remove files that are no longer needed file: path: "{{ release_theme_path }}/{{ item }}" state: absent 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