-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·27 lines (23 loc) · 883 Bytes
/
start.sh
File metadata and controls
executable file
·27 lines (23 loc) · 883 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
#!/bin/bash
FILE=".secret.sentry"
if [ ! -f $FILE ];
then
tr -cd '[:alnum:]' < /dev/urandom | fold -w32 | head -n1 > $FILE
fi
SENTRY_SECRET_KEY=$(<$FILE)
echo "Setting SENTRY_SECRET_KEY="$SENTRY_SECRET_KEY
FILE=".secret.postgres"
if [ ! -f $FILE ];
then
tr -cd '[:alnum:]' < /dev/urandom | fold -w32 | head -n1 > $FILE
fi
POSTGRES_PASSWORD=$(<$FILE)
echo "Settings POSTGRES_PASSWORD="$POSTGRES_PASSWORD
export SENTRY_SECRET_KEY=$SENTRY_SECRET_KEY
export POSTGRES_PASSWORD="$POSTGRES_PASSWORD"
docker-compose stop
docker-compose up -d postgres && sleep 4
docker-compose run postgres sh -c "PGPASSWORD=$POSTGRES_PASSWORD exec createdb -h \$POSTGRES_PORT_5432_TCP_ADDR -p \$POSTGRES_PORT_5432_TCP_PORT -U postgres sentry"
docker-compose run sentry sentry upgrade
SENTRY_SECRET_KEY=$SENTRY_SECRET_KEY,POSTGRES_PASSWORD=$POSTGRES_PASSWORD docker-compose up -d
docker-compose logs