-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_docker_compose
executable file
·34 lines (25 loc) · 1013 Bytes
/
run_docker_compose
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
#!/usr/bin/env bash
set -Eeuo pipefail
export BOT_NAME="${BOT_NAME:-makumistake}"
credentials_secret_name="${credentials_secret_name:-$BOT_NAME}"
credentials=$(aws secretsmanager get-secret-value \
--secret-id "$credentials_secret_name" \
--query SecretString \
--output text)
export AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY
export DISCORD_BOT_TOKEN
export PGPASSWORD
export GOOGLE_API_KEY
AWS_ACCESS_KEY_ID=$(echo "$credentials" | jq -r ".AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY=$(echo "$credentials" | jq -r ".AWS_SECRET_ACCESS_KEY")
GOOGLE_API_KEY=$(echo "$credentials" | jq -r ".GOOGLE_API_KEY")
DISCORD_BOT_TOKEN=$(echo "$credentials" | jq -r ".DISCORD_TOKEN")
PGPASSWORD=$(echo "$credentials" | jq -r ".PGPASSWORD")
export S3_BUCKET="${S3_BUCKET:-$BOT_NAME}"
export PGHOST="${PGHOST:-mbdb}"
export PGPORT="${PGPORT:-5432}"
export PGUSER="${PGUSER:-postgres}"
export PGNAME="${PGNAME:-postgres}"
docker-compose down
docker-compose up --build --abort-on-container-exit --remove-orphans