-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproduction_server
More file actions
executable file
·48 lines (39 loc) · 959 Bytes
/
production_server
File metadata and controls
executable file
·48 lines (39 loc) · 959 Bytes
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
#!/bin/bash -e
declare CHECKER_MAL_SECRET MAL_CLIENTID
CHECKER_MAL_SECRET="${CHECKER_MAL_SECRET:?No CHECKER_MAL_SECRET environment variable set}"
MAL_CLIENTID="${MAL_CLIENTID?:No MAL Client ID set}"
MIX_ENV=prod
declare -rx CHECKER_MAL_SECRET MIX_ENV MAL_CLIENTID
THIS_DIR="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
cd "${THIS_DIR}" || exit $?
DATABASE_PATH="${THIS_DIR}/data/prod.db"
export DATABASE_PATH
case "$1" in
# drop into an interactive shell after loading environment secrets
--shell)
echo "Dropping into interactive shell with secrets..."
bash
exit 0
;;
--iex)
# drop into iex after loading environment secrets
iex -S mix
exit 0
;;
--run)
:
;;
*)
echo "Must specify one of:"
grep -P '^\s*--?[\w-]+\)' "$(realpath "$0")" | tr -d '); '
exit 1
;;
esac
mix deps.get --only prod
mix compile
mix prod.setup
cd ./assets/
npm install --legacy-peer-deps
npm run deploy
cd "${THIS_DIR}" || exit $?
exec mix checker_mal.prod.server