Skip to content

Commit

Permalink
[Refactor] Remove become user and set become false to configure build…
Browse files Browse the repository at this point in the history
… locally
  • Loading branch information
JohnMwashuma committed Mar 1, 2024
1 parent a6e0272 commit 4e8c8fb
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
path: "{{ react_local_checkout_path }}"
production: false
delegate_to: localhost
become: true
become_user: "{{ react_local_user }}"
become: false

- name: Build app locally
become_user: "{{ react_local_user }}"
become: true
become: false
delegate_to: localhost
environment: "{{ item.env | default(react_build_cmds_default_env) }}"
command: "yarn {{ item.cmd | default(react_build_default_cmd) }} {{ item.args | default() }}"
Expand All @@ -37,31 +35,27 @@
chdir: "{{ react_local_checkout_path }}"
ignore_errors: true
delegate_to: localhost
become: true
become_user: "{{ react_local_user }}"
become: false

- name: remove node_modules manually
file:
path: "{{ react_local_checkout_path }}/node_modules"
state: absent
delegate_to: localhost
become: true
become_user: "{{ react_local_user }}"
become: false

- name: Compress Build folder locally
archive:
path: "{{ react_local_checkout_path }}/"
dest: "{{ react_local_checkout_path }}.tgz"
delegate_to: localhost
become: true
become_user: "{{ react_local_user }}"
become: false

- name: UnCompress Build folder to remote host
unarchive:
src: "{{ react_local_checkout_path }}.tgz"
dest: "{{ react_checkout_path }}"
become: true
become_user: "{{ react_system_user }}"
become: false
when: "not react_remote_js_build|bool"

- name: configure build remotely
Expand Down

0 comments on commit 4e8c8fb

Please sign in to comment.