Skip to content

Commit

Permalink
Merge pull request #5 from sarveshwarge/master
Browse files Browse the repository at this point in the history
even with master
  • Loading branch information
sarveshpro authored Apr 20, 2020
2 parents cf76a81 + 4c08207 commit ce4ac06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# n8n-heroku

![Docker](https://github.com/sarveshwarge/n8n-heroku/workflows/Docker/badge.svg)
![Docker](https://github.com/sarveshwarge/n8n-heroku/workflows/Docker/badge.svg) ![Test Heroku](https://github.com/sarveshwarge/n8n-heroku/workflows/Test%20Heroku/badge.svg)

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/sarveshwarge/n8n-heroku)

Expand Down
14 changes: 7 additions & 7 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ parse_url() {
eval $(echo "$1" | sed -e "s#^\(\(.*\)://\)\?\(\([^:@]*\)\(:\(.*\)\)\?@\)\?\([^/?]*\)\(/\(.*\)\)\?#${PREFIX:-URL_}SCHEME='\2' ${PREFIX:-URL_}USER='\4' ${PREFIX:-URL_}PASSWORD='\6' ${PREFIX:-URL_}HOSTPORT='\7' ${PREFIX:-URL_}DATABASE='\9'#")
}

# received url as argument
ARG_URL=${1:-""}

# if config vars detected
if [ "$DATABASE_URL" ]
then
ARG_URL=${1:-$DATABASE_URL}
ARG_URL=$DATABASE_URL
echo $DATABASE_URL;
echo "postgre config detected"

elif [ "$MONGODB_URI" ]
then
ARG_URL=${1:-$MONGODB_URI}
ARG_URL=$MONGODB_URI
echo "mongo config detected"

else
echo "no config vars found"
fi

# received url as argument
ARG_URL=${1:-"http://user:[email protected]/path/somewhere"}

# prefix variables to avoid conflicts and run parse url function on arg url
PREFIX="N8N_DB_" parse_url "$ARG_URL"

#echo "$N8N_DB_SCHEME://$N8N_DB_USER:$N8N_DB_PASSWORD@$N8N_DB_HOSTPORT/$N8N_DB_DATABASE"
echo "$N8N_DB_SCHEME://$N8N_DB_USER:$N8N_DB_PASSWORD@$N8N_DB_HOSTPORT/$N8N_DB_DATABASE"

# Separate host and port
N8N_DB_HOST="$(echo $N8N_DB_HOSTPORT | sed -e 's,:.*,,g')"
Expand Down Expand Up @@ -59,4 +59,4 @@ else
fi

# kickstart nodemation
n8n
# n8n

0 comments on commit ce4ac06

Please sign in to comment.