-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
105 lines (86 loc) · 3.56 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
help:
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \
for help_line in $${help_lines[@]}; do \
IFS=$$'#' ; \
help_split=($$help_line) ; \
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
printf "%-30s %s\n" $$help_command $$help_info ; \
done
include makefiles/utils.mk
build_jar: ## Builds the jar file
./gradlew clean build -x test
test:
./gradlew clean test --stacktrace
build_server: build_jar
# <server>
start_server: build_server
java -jar ./build/libs/etl-1.0.0-SNAPSHOT.jar
start_server_with_dump_data_org: build_server
OPENCHS_DATABASE_NAME=avni_org OPENCHS_CLIENT_ID=dummy OPENCHS_KEYCLOAK_CLIENT_SECRET=dummy AVNI_IDP_TYPE=none java -jar ./build/libs/etl-1.0.0-SNAPSHOT.jar
debug_server: build_server
java -Xmx2048m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar ./build/libs/etl-1.0.0-SNAPSHOT.jar
debug_server_with_dump_data_org: build_server
OPENCHS_DATABASE_NAME=avni_org OPENCHS_CLIENT_ID=dummy OPENCHS_KEYCLOAK_CLIENT_SECRET=dummy AVNI_IDP_TYPE=none java -Xmx2048m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar ./build/libs/etl-1.0.0-SNAPSHOT.jar
start_server_prerelease: build_server
-mkdir -p /tmp/openchs && sudo ln -s /tmp/openchs /var/log/openchs
AVNI_IDP_TYPE=cognito \
OPENCHS_CLIENT_ID=$(OPENCHS_CLIENT_ID) \
OPENCHS_USER_POOL=$(OPENCHS_USER_POOL) \
OPENCHS_IAM_USER=$(OPENCHS_IAM_USER) \
OPENCHS_IAM_USER_ACCESS_KEY=$(OPENCHS_IAM_USER_ACCESS_KEY) \
OPENCHS_IAM_USER_SECRET_ACCESS_KEY=$(OPENCHS_IAM_USER_SECRET_ACCESS_KEY) \
OPENCHS_BUCKET_NAME=prerelease-user-media \
OPENCHS_DATABASE_URL=jdbc:postgresql://localhost:5433/openchs \
java -jar ./build/libs/etl-1.0.0-SNAPSHOT.jar
start_server_staging: build_server
-mkdir -p /tmp/avni-etl-service && sudo ln -s /tmp/avni-etl-service /var/log/avni-etl-service
AVNI_IDP_TYPE=cognito \
OPENCHS_CLIENT_ID=$(OPENCHS_STAGING_APP_CLIENT_ID) \
OPENCHS_USER_POOL=$(OPENCHS_STAGING_USER_POOL_ID) \
OPENCHS_IAM_USER=$(OPENCHS_STAGING_IAM_USER) \
OPENCHS_IAM_USER_ACCESS_KEY=$(OPENCHS_STAGING_IAM_USER_ACCESS_KEY) \
OPENCHS_IAM_USER_SECRET_ACCESS_KEY=$(OPENCHS_STAGING_IAM_USER_SECRET_ACCESS_KEY) \
OPENCHS_BUCKET_NAME=staging-user-media \
OPENCHS_DATABASE_URL=jdbc:postgresql://localhost:5433/openchs \
java -jar ./build/libs/etl-1.0.0-SNAPSHOT.jar
boot_run:
./gradlew bootRun
create-extensions:
-psql -h localhost -Uopenchs openchs_test -c 'create extension if not exists "uuid-ossp"';
-psql -h localhost -Uopenchs openchs_test -c 'create extension if not exists "ltree"';
-psql -h localhost -Uopenchs openchs_test -c 'create extension if not exists "hstore"';
open-test-results:
open build/reports/tests/test/index.html
start: boot_run
debug:
./gradlew bootRun -Dagentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
delete-etl-metadata:
ifndef schemaName
@echo "Provde the schemaName variable"
exit 1
endif
ifndef dbUser
@echo "Provde the dbUser variable"
exit 1
endif
ifndef db
@echo "Provde the db variable"
exit 1
endif
-psql -h localhost -Uopenchs $(db) -c "select delete_etl_metadata_for_schema('$(schemaName)', '$(dbUser)')"
delete-etl-metadata-for-org:
ifndef schemaName
@echo "Provde the schemaName variable"
exit 1
endif
ifndef dbUser
@echo "Provde the dbUser variable"
exit 1
endif
ifndef db
@echo "Provde the db variable"
exit 1
endif
-psql -h localhost -Uopenchs $(db) -c "select delete_etl_metadata_for_org('$(schemaName)', '$(dbUser)')"