forked from tryretool/retool-onpremise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
retooldb_upgrade.sh
executable file
·28 lines (23 loc) · 1.08 KB
/
retooldb_upgrade.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
#!/bin/bash
retooldbPostgresPassword=$(cat /dev/urandom | base64 | head -c 64)
if [ -f ./retooldb.env ]; then
echo "RetoolDB credentials have already been set"
exit 1
fi
touch retooldb.env
echo '## Set and generate retooldb postgres credentials' >> docker.env
echo '## These variables are only for the initial deploy and all resource updates will need to be done in the Retool UI' >> docker.env
echo 'RETOOLDB_POSTGRES_HOST=retooldb-postgres' >> docker.env
echo 'RETOOLDB_POSTGRES_DB=postgres' >> docker.env
echo 'RETOOLDB_POSTGRES_USER=root' >> docker.env
echo 'RETOOLDB_POSTGRES_PORT=5432' >> docker.env
echo "RETOOLDB_POSTGRES_PASSWORD=${retooldbPostgresPassword}" >> docker.env
echo '' >> docker.env
echo '## Set and generate retooldb postgres credentials' >> retooldb.env
echo 'POSTGRES_HOST=retooldb-postgres' >> retooldb.env
echo 'POSTGRES_DB=postgres' >> retooldb.env
echo 'POSTGRES_USER=root' >> retooldb.env
echo "POSTGRES_PASSWORD=${retooldbPostgresPassword}" >> retooldb.env
echo 'POSTGRES_PORT=5432' >> retooldb.env
echo '' >> retooldb.env
echo "RetoolDB upgrade script has been run"