mirror of https://github.com/status-im/codimd.git
Fix heroku production db setting
This commit is contained in:
parent
9769b0c872
commit
50b72c7f03
33
bin/heroku
33
bin/heroku
|
@ -18,6 +18,36 @@ module.exports = {
|
|||
}
|
||||
|
||||
EOF
|
||||
regex='postgres:\/\/([^:]+):([^@]+)@([^:]+):([^\/]+)\/(.+)'
|
||||
|
||||
if [[ $DATABASE_URL =~ $regex ]]; then
|
||||
|
||||
username="${BASH_REMATCH[1]}"
|
||||
password="${BASH_REMATCH[2]}"
|
||||
host="${BASH_REMATCH[3]}"
|
||||
port="${BASH_REMATCH[4]}"
|
||||
database="${BASH_REMATCH[5]}"
|
||||
|
||||
cat << EOF > config.json
|
||||
|
||||
{
|
||||
"production": {
|
||||
"db": {
|
||||
"dialect": "postgres",
|
||||
"host": "${host}",
|
||||
"username": "${username}",
|
||||
"password": "${password}",
|
||||
"database": "${database}",
|
||||
"port": "${port}",
|
||||
"dialectOptions": {
|
||||
"ssl": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EOF
|
||||
else
|
||||
|
||||
cat << EOF > config.json
|
||||
|
||||
|
@ -28,6 +58,9 @@ EOF
|
|||
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
cp public/js/config.js.example public/js/config.js
|
||||
|
||||
# build app
|
||||
|
|
Loading…
Reference in New Issue