Skip to content

Commit

Permalink
Merge pull request #17 from onaio/monorepoSupport
Browse files Browse the repository at this point in the history
Modify path where .env file is created
  • Loading branch information
peterMuriuki authored Oct 29, 2020
2 parents afde330 + 4d8568e commit 0b68d4c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
5 changes: 4 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ react_node_version: 10.x

# app
react_remote_js_build: true
react_local_checkout_path: "/tmp/{{ react_local_user }}/reveal"
react_local_checkout_path: "/tmp/react/{{ ansible_date_time['epoch'] }}"
react_local_app_path: "{{ react_local_checkout_path }}"
react_env_name: "prod"
react_app_name: "{{ react_system_user }}"
react_codebase_path: "{{ react_system_user_home }}/app"
react_versioned_path: "{{ react_codebase_path }}-versioned"
# where the repository is cloned
react_checkout_path: "{{ react_versioned_path }}/{{ ansible_date_time['epoch'] }}"
# where the actual app package is
react_app_path: "{{ react_checkout_path }}"
react_log_path: "/var/log/{{ react_app_name }}"
react_max_versioned_folders: 10
Expand Down
6 changes: 4 additions & 2 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
react_system_group: "www-data"
react_system_user_home: "/home/{{ react_system_user }}"
react_node_version: 10.x
react_git_url: "https://github.com/onaio/reveal-frontend"
react_git_version: "v0.6.2-rc1"
react_git_url: "https://github.com/OpenSRP/web.git"
react_git_version: "master"
react_app_settings:
GENERATE_SOURCEMAP: "false"
SKIP_PREFLIGHT_CHECK: "true"
react_remote_js_build: false
react_local_app_path: "{{ react_local_checkout_path }}/client"
react_app_path: "{{ react_checkout_path }}/client"
27 changes: 19 additions & 8 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- name: Copy environment variables file locally
template:
src: env.j2
dest: "{{ react_local_checkout_path }}/.env"
dest: "{{ react_local_app_path }}/.env"
mode: 0644
delegate_to: localhost
become: true
Expand All @@ -27,12 +27,23 @@
become_user: "{{ react_local_user }}"

- name: Remove node_modules before compression
file:
path: "{{ react_local_checkout_path }}/node_modules"
state: absent
delegate_to: localhost
become: true
become_user: "{{ react_local_user }}"
block:
- name: Remove node_modules using lerna where possible
command: yarn lerna clean -y
args:
chdir: "{{ react_local_checkout_path }}"
ignore_errors: true
delegate_to: localhost
become: true
become_user: "{{ react_local_user }}"

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

- name: Compress Build folder locally
archive:
Expand All @@ -55,7 +66,7 @@
- name: Copy environment variables file
template:
src: env.j2
dest: "{{ react_checkout_path }}/.env"
dest: "{{ react_app_path }}/.env"
mode: 0644

- name: Install Javascript requirements
Expand Down

0 comments on commit 0b68d4c

Please sign in to comment.