This repository was archived by the owner on Oct 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.yml
More file actions
74 lines (66 loc) · 2.49 KB
/
main.yml
File metadata and controls
74 lines (66 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
- name: Perform NPM and extra steps.
when:
- deploy_operation == 'deploy'
block:
- name: Perform NPM steps.
ansible.builtin.command:
cmd: "{{ npm.executor }} {{ npm_command }}"
chdir: "{{ npm.working_dir }}"
with_items: "{{ npm.commands }}"
loop_control:
loop_var: npm_command
register: _npm_results
- name: Show NPM commands output.
ansible.builtin.debug:
msg: "{{ item.npm_command }} >>> rc={{ item.rc }}, stdout={{ item.stdout }}"
loop: "{{ _npm_results.results }}"
- name: Run extra drush commands from the first site's dir.
ansible.builtin.command:
cmd: "{{ drush_bin }} {{ extra_drush_command }}"
chdir: "{{ deploy_path }}/{{ webroot }}/sites/{{ drupal.sites[0].folder }}"
with_items: "{{ npm.extra_drush_commands }}"
loop_control:
loop_var: extra_drush_command
register: _extra_drush_command_results
- name: Show extra drush commands output.
ansible.builtin.debug:
msg: "{{ item.extra_drush_command }} >>> rc={{ item.rc }}, stdout={{ item.stdout }}"
loop: "{{ _extra_drush_command_results.results }}"
- name: Run extra npm commands from node app dir.
ansible.builtin.command:
cmd: "{{ npm.executor }} {{ extra_npm_command }}"
chdir: "{{ npm.working_dir }}"
with_items: "{{ npm.extra_npm_commands }}"
loop_control:
loop_var: extra_npm_command
register: _extra_npm_command_results
- name: Show extra npm commands output.
ansible.builtin.debug:
msg: "{{ item.extra_npm_command }} >>> rc={{ item.rc }}, stdout={{ item.stdout }}"
loop: "{{ _extra_npm_command_results.results }}"
- name: Remove node_modules.
ansible.builtin.file:
path: "{{ npm.working_dir }}/node_modules"
state: absent
when: npm.remove_node_modules
- name: Generate additional templates.
ansible.builtin.template:
src: "{{ template.src }}"
dest: "{{ deploy_path }}/{{ template.dest }}"
with_items: "{{ npm.templates }}"
loop_control:
loop_var: template
when:
- npm.templates | length > 0
- name: Create additional symlinks.
ansible.builtin.file:
src: "{{ link.src }}"
dest: "{{ deploy_path }}/{{ link.dest }}"
state: link
force: "{{ link.force | default(false) }}"
with_items: "{{ npm.symlinks }}"
loop_control:
loop_var: link
when:
- npm.symlinks | length > 0