Ansible: Extract an include for building theme assets
This commit is contained in:
parent
e874475c32
commit
9dbcf903f4
|
@ -31,25 +31,4 @@
|
|||
register: config_import_result
|
||||
changed_when: "'There are no changes to import' not in config_import_result.stderr"
|
||||
|
||||
- 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
|
||||
- include: ../includes/build-theme-assets.yml
|
||||
|
|
26
tools/ansible/includes/build-theme-assets.yml
Normal file
26
tools/ansible/includes/build-theme-assets.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
- name: Export body values to include in theme purging
|
||||
command: >
|
||||
{{ release_drush_path }} opdavies:export-body-values-for-theme-purging
|
||||
chdir={{ release_theme_path }}
|
||||
creates={{ release_theme_path }}/body-field-values.txt
|
||||
|
||||
- name: Install theme dependencies
|
||||
command: >
|
||||
npm install
|
||||
chdir={{ release_theme_path }}
|
||||
creates={{ release_theme_path }}/node_modules
|
||||
|
||||
- name: Generate front-end assets
|
||||
command: >
|
||||
npm run production
|
||||
chdir={{ release_theme_path }}
|
||||
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
|
Loading…
Reference in a new issue