-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathentrypoint.sh
executable file
·52 lines (43 loc) · 1.31 KB
/
entrypoint.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
46
47
48
49
50
51
52
#!/bin/bash
# shellcheck disable=SC1090
echo "
____ _ ____ _
| _ \ | | | _ \ | |
| |_) | __ _ ___| |__ | |_) | ___ | |_
| _ < / _' / __| '_ \| _ < / _ \| __|
| |_) | (_| \__ \ | | | |_) | (_) | |_
|____/ \__,_|___/_| |_|____/ \___/ \__|"
if ! command -v bashbot > /dev/null; then
echo "bashbot is not installed. Please install bashbot and try again."
exit 1
fi
# If .env file is present, load it.
if [ -f "$BASHBOT_ENV_VARS_FILEPATH" ]; then
. "$BASHBOT_ENV_VARS_FILEPATH"
fi
if ! [ -f "$BASHBOT_CONFIG_FILEPATH" ]; then
echo "bashbot config file not found. Please create one and try again."
exit 1
fi
if [ -z "$SLACK_BOT_TOKEN" ]; then
echo "SLACK_BOT_TOKEN is not set. Please set it and try again."
exit 1
fi
if [ -z "$SLACK_APP_TOKEN" ]; then
echo "SLACK_APP_TOKEN is not set. Please set it and try again."
exit 1
fi
mkdir -p vendor
sleep 4
# If the log-level doesn't exist, set it to 'info'
LOG_LEVEL=${LOG_LEVEL:-info}
# If the log-format doesn't exist, set it to 'text'
LOG_FORMAT=${LOG_FORMAT:-text}
# Run install-dependencies path
bashbot install-dependencies \
--log-level "$LOG_LEVEL" \
--log-format "$LOG_FORMAT"
# Run Bashbot binary passing the config file and the Slack token
bashbot run \
--log-level "$LOG_LEVEL" \
--log-format "$LOG_FORMAT"