Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor git clone local #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@
dest: "{{ react_local_app_path }}/.env"
mode: 0644
delegate_to: localhost
become: true
become_user: "{{ react_local_user }}"
become: false

- name: Install Javascript requirements locally
yarn:
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 @@ -38,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
3 changes: 1 addition & 2 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@
version: "{{ react_git_version }}"
depth: 1
force: true
become: true
become: false
delegate_to: localhost
become_user: "{{ react_local_user }}"
when: " not react_remote_js_build|bool"

- name: Remote Git clone
Expand Down
Loading