|
18 | 18 | become: true
|
19 | 19 | become_user: "{{ react_local_user }}"
|
20 | 20 |
|
21 |
| - - name: Compile Javascript locally |
22 |
| - command: yarn build |
23 |
| - args: |
24 |
| - chdir: "{{ react_local_checkout_path }}" |
25 |
| - delegate_to: localhost |
26 |
| - become: true |
| 21 | + - name: Build app locally |
27 | 22 | become_user: "{{ react_local_user }}"
|
| 23 | + become: true |
| 24 | + delegate_to: localhost |
| 25 | + environment: "{{ item.env | default(react_build_cmds_default_env) }}" |
| 26 | + command: "yarn {{ item.cmd | default(react_build_default_cmd) }} {{ item.args | default() }}" |
| 27 | + register: yarn_build_result |
| 28 | + args: |
| 29 | + chdir: "{{ item.path | default(react_local_checkout_path) }}" |
| 30 | + failed_when: "yarn_build_result.stderr is defined and yarn_build_result.stderr.find('error ') != -1" |
| 31 | + with_items: "{{ react_build_cmds }}" |
28 | 32 |
|
29 | 33 | - name: Remove node_modules before compression
|
30 | 34 | block:
|
|
39 | 43 |
|
40 | 44 | - name: remove node_modules manually
|
41 | 45 | file:
|
42 |
| - path: "{{ react_checkout_path }}/node_modules" |
| 46 | + path: "{{ react_local_checkout_path }}/node_modules" |
43 | 47 | state: absent
|
44 | 48 | delegate_to: localhost
|
45 | 49 | become: true
|
|
76 | 80 | become: true
|
77 | 81 | become_user: "{{ react_system_user }}"
|
78 | 82 |
|
79 |
| - - name: Compile Javascript |
80 |
| - command: yarn build |
81 |
| - args: |
82 |
| - chdir: "{{ react_checkout_path }}" |
83 |
| - become: true |
| 83 | + - name: Build app locally |
84 | 84 | become_user: "{{ react_system_user }}"
|
| 85 | + become: true |
| 86 | + environment: "{{ item.env | default(react_build_cmds_default_env) }}" |
| 87 | + command: "yarn {{ item.cmd | default(react_build_default_cmd) }} {{ item.args | default() }}" |
| 88 | + register: yarn_build_result |
| 89 | + args: |
| 90 | + chdir: "{{ item.path | default(react_checkout_path) }}" |
| 91 | + failed_when: "yarn_build_result.stderr is defined and yarn_build_result.stderr.find('error ') != -1" |
| 92 | + with_items: "{{ react_build_cmds }}" |
85 | 93 |
|
86 | 94 | when: "react_remote_js_build|bool"
|
87 | 95 |
|
|
0 commit comments