This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
tasks
executable file
·72 lines (67 loc) · 1.86 KB
/
tasks
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
#!/usr/bin/env sh
project_dir="$( cd "$( dirname "$0" )" > /dev/null && pwd )"
backend_dir="${project_dir}/backend"
frontend_dir="${project_dir}/frontend"
set -e
set_local_environment_variables() {
export DB_USERNAME=postgres
export DB_PASSWORD=test
export DB_API_USERNAME=apiuser
export DB_API_PASSWORD=test
export DB_HOST=localhost
export DB_NAME=systemregister
export KC_HOST=localhost
export KC_PORT=8081
export KC_REALM=local-realm
export KC_CLIENT_ID=system-register
export DEV_KEYCLOAK_ADMIN_PASSWORD=test
export REACT_APP_KEYCLOAK_URL=http://localhost:8081/auth/
export REACT_APP_KEYCLOAK_REALM=local-realm
export REACT_APP_KEYCLOAK_CLIENT_ID=system-register
# export REACT_APP_API_URL=http://localhost:8080/api
}
for command in "$@"
do
echo "--- ${command} ---"
case "${command}" in
clean)
rm -rf "$frontend_dir/build/"
cd "$backend_dir"
mvn clean
cd "$project_dir"
;;
build-frontend)
echo "Building for local development environment..."
set_local_environment_variables
cd $frontend_dir
yarn install
./audit.sh
yarn test --watchAll=false
yarn run build
cd $project_dir
;;
build-backend)
cd $backend_dir
mkdir -p $backend_dir/src/main/resources/META-INF/resources/
cp -r $frontend_dir/build/* $backend_dir/src/main/resources/META-INF/resources/
mvn verify
cd $project_dir
;;
dev-frontend)
cd $frontend_dir
yarn start
;;
dev-backend)
set_local_environment_variables
cd $backend_dir
docker-compose -f compose/local-deps.yml up -d
export QUARKUS_PROFILE=dev
mvn compile quarkus:dev
;;
*)
echo "Invalid command: '${command}'"
exit 1
;;
esac
done
set +e