-
Notifications
You must be signed in to change notification settings - Fork 57
/
run
executable file
·38 lines (24 loc) · 898 Bytes
/
run
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
#!/bin/bash
if [[ -d "/var/task/snowalert/venv/bin" && -d "/var/task/snowalert/src" ]]; then
echo "running in docker container-like environment"
if [[ "$1" == "webui" ]]; then
cd /var/task/snowalert/src/webui/backend
python webui/app.py
elif [ "$1" == "process-baseline" ]; then
cd /var/task/snowalert/src/sars
./run.sh
else
cd /var/task/snowalert/src/runners/
python run.py $@
fi
elif [[ -d "$HOME/.snowsql" && -d "$HOME/.aws" ]]; then
echo "running in client development-like environment"
if [[ ! -f "$1" ]]; then
>&2 echo "usage: ./run snowalert-{env}.envs {command}"
>&2 echo "if you don't have an env file, run ./install first"
exit 1
fi
docker run -it --env-file "$1" snowsec/snowalert ./run $2
else
echo "please run in docker or make sure you have aws credentials in ~/.aws and snowflake credentials in ~/.snowsql"
fi