forked from avniproject/avni-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
107 lines (80 loc) · 3.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
clean:
rm -rf node_modules
check-project-versions:
npm search openchs-models
npm search avni-health-modules
deps:
yarn install
start:
yarn start
start-dark:
yarn start-dark
start-with-staging:
yarn start-with-staging
start-with-prerelease:
yarn start-with-prerelease
start-with-prod:
yarn start-with-prod
storybook:
yarn storybook
test-only:
yarn test --watchAll
test: build-app test-only
build-app:
yarn run build
prettier-all:
yarn prettier-all
cy-run:
yarn cy:run
cy-open:
yarn cy:open
port:= $(if $(port),$(port),8021)
server:= $(if $(server),$(server),http://localhost)
auth:
ifndef password
@echo "Please provide password for the admin user"
exit 1
endif
$(if $(password),$(eval token:=$(shell node scripts/token.js '$(server):$(port)' $(username) $(password))))
upload = \
curl -X POST $(server):$(port)/$(1) -d $(2) \
-H "Content-Type: application/json" \
-H "USER-NAME: admin" \
-H "AUTH-TOKEN: $(token)"
deploy_platform_translations: auth
$(call upload,platformTranslation,@translations/en.json)
@echo
$(call upload,platformTranslation,@translations/gu_IN.json)
@echo
$(call upload,platformTranslation,@translations/hi_IN.json)
@echo
$(call upload,platformTranslation,@translations/mr_IN.json)
@echo
$(call upload,platformTranslation,@translations/ta_IN.json)
@echo
$(call upload,platformTranslation,@translations/ka_IN.json)
deploy_platform_translations_staging:
make deploy_platform_translations poolId=$(OPENCHS_STAGING_USER_POOL_ID) clientId=$(OPENCHS_STAGING_APP_CLIENT_ID) server=https://staging.avniproject.org port=443 username=admin password=$(OPENCHS_STAGING_ADMIN_PASSWORD)
deploy_platform_translations_live:
make deploy_platform_translations poolId=$(OPENCHS_PROD_USER_POOL_ID) clientId=$(OPENCHS_PROD_APP_CLIENT_ID) server=https://app.avniproject.org port=443 username=admin password=$(OPENCHS_PROD_ADMIN_PASSWORD)
deploy_platform_translations_production: deploy_platform_translations_live
deploy_platform_translations_prerelease:
make deploy_platform_translations poolId=$(OPENCHS_PRERELEASE_USER_POOL_ID) clientId=$(OPENCHS_PRERELEASE_APP_CLIENT_ID) server=https://prerelease.avniproject.org port=443 username=admin password=$(OPENCHS_PRERELEASE_ADMIN_PASSWORD)
deploy_platform_translations_rwb_staging:
make deploy_platform_translations poolId=$(RWB_STAGING_USER_POOL_ID) clientId=$(RWB_STAGING_APP_CLIENT_ID) server=https://staging.rwb.avniproject.org port=443 username=admin password=$(RWB_STAGING_ADMIN_PASSWORD)
deploy_platform_translations_rwb_prod:
make deploy_platform_translations poolId=$(RWB_PROD_USER_POOL_ID) clientId=$(RWB_PROD_APP_CLIENT_ID) server=https://app.rwb.avniproject.org port=443 username=admin password=$(RWB_PROD_ADMIN_PASSWORD)
deploy_static_local:
-rm -rf ../avni-server/static
mkdir ../avni-server/static
cp -r public/* ../avni-server/static
deploy_build_local: build-app
-rm -rf ../avni-server/static
mkdir ../avni-server/static
cp -r build/* ../avni-server/static
zip-app:
yarn install
yarn run build
tar -czvf avni-webapp.tgz -C build .
zip-app-only:
tar -czvf avni-webapp.tgz -C build .