Skip to content

Commit 0b68d4c

Browse files
authored
Merge pull request #17 from onaio/monorepoSupport
Modify path where .env file is created
2 parents afde330 + 4d8568e commit 0b68d4c

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

defaults/main.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ react_node_version: 10.x
2323

2424
# app
2525
react_remote_js_build: true
26-
react_local_checkout_path: "/tmp/{{ react_local_user }}/reveal"
26+
react_local_checkout_path: "/tmp/react/{{ ansible_date_time['epoch'] }}"
27+
react_local_app_path: "{{ react_local_checkout_path }}"
2728
react_env_name: "prod"
2829
react_app_name: "{{ react_system_user }}"
2930
react_codebase_path: "{{ react_system_user_home }}/app"
3031
react_versioned_path: "{{ react_codebase_path }}-versioned"
32+
# where the repository is cloned
3133
react_checkout_path: "{{ react_versioned_path }}/{{ ansible_date_time['epoch'] }}"
34+
# where the actual app package is
3235
react_app_path: "{{ react_checkout_path }}"
3336
react_log_path: "/var/log/{{ react_app_name }}"
3437
react_max_versioned_folders: 10

molecule/default/converge.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
react_system_group: "www-data"
99
react_system_user_home: "/home/{{ react_system_user }}"
1010
react_node_version: 10.x
11-
react_git_url: "https://github.com/onaio/reveal-frontend"
12-
react_git_version: "v0.6.2-rc1"
11+
react_git_url: "https://github.com/OpenSRP/web.git"
12+
react_git_version: "master"
1313
react_app_settings:
1414
GENERATE_SOURCEMAP: "false"
1515
SKIP_PREFLIGHT_CHECK: "true"
1616
react_remote_js_build: false
17+
react_local_app_path: "{{ react_local_checkout_path }}/client"
18+
react_app_path: "{{ react_checkout_path }}/client"

tasks/configure.yml

+19-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- name: Copy environment variables file locally
55
template:
66
src: env.j2
7-
dest: "{{ react_local_checkout_path }}/.env"
7+
dest: "{{ react_local_app_path }}/.env"
88
mode: 0644
99
delegate_to: localhost
1010
become: true
@@ -27,12 +27,23 @@
2727
become_user: "{{ react_local_user }}"
2828

2929
- name: Remove node_modules before compression
30-
file:
31-
path: "{{ react_local_checkout_path }}/node_modules"
32-
state: absent
33-
delegate_to: localhost
34-
become: true
35-
become_user: "{{ react_local_user }}"
30+
block:
31+
- name: Remove node_modules using lerna where possible
32+
command: yarn lerna clean -y
33+
args:
34+
chdir: "{{ react_local_checkout_path }}"
35+
ignore_errors: true
36+
delegate_to: localhost
37+
become: true
38+
become_user: "{{ react_local_user }}"
39+
40+
- name: remove node_modules manually
41+
file:
42+
path: "{{ react_checkout_path }}/node_modules"
43+
state: absent
44+
delegate_to: localhost
45+
become: true
46+
become_user: "{{ react_local_user }}"
3647

3748
- name: Compress Build folder locally
3849
archive:
@@ -55,7 +66,7 @@
5566
- name: Copy environment variables file
5667
template:
5768
src: env.j2
58-
dest: "{{ react_checkout_path }}/.env"
69+
dest: "{{ react_app_path }}/.env"
5970
mode: 0644
6071

6172
- name: Install Javascript requirements

0 commit comments

Comments
 (0)