-
Notifications
You must be signed in to change notification settings - Fork 0
/
gallery.sh
executable file
·46 lines (39 loc) · 956 Bytes
/
gallery.sh
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
#!/bin/sh
[ "$1" == "" ] && {
echo "Missing command name"
exit 1
}
COMMAND="$1"
shift
invoke()
{
echo "Invoking: " $*
$*
}
invoke_front()
{
cd front;
pnpm install;
echo "Invoking: " $*
$*
cd -
}
invoke_terraform() {
cd terraform
terraform $*
cd -
}
case "$COMMAND" in
"terraform_config") invoke "python -m cli terraform_config";;
"terraform") invoke_terraform $*;;
"ingest") invoke "python -m cli ingest $*";;
"resize") invoke "python -m cli resize $*";;
"build_front") invoke_front "pnpm build";;
"sync_bucket") invoke "python -m cli sync_bucket $*";;
"dev_front") invoke_front "pnpm dev";;
"preview_front") invoke_front "pnpm preview";;
"build_server") invoke "python -m cli build_server";;
"build_server_dev") invoke "python -m cli build_server --dev";;
"deploy_server") invoke "python -m cli deploy_server";;
*) echo "Unknown command \"$COMMAND\""; exit 3
esac