Skip to content

Instantly share code, notes, and snippets.

@dillonhafer
Last active May 15, 2017 17:18
Show Gist options
  • Save dillonhafer/c17fa891bbf67cf21d3872f3eaaccf43 to your computer and use it in GitHub Desktop.
Save dillonhafer/c17fa891bbf67cf21d3872f3eaaccf43 to your computer and use it in GitHub Desktop.
Use a different database per git branch
branch=$(git rev-parse --abbrev-ref HEAD | grep -o 'PHI-\d*')
if [[ -z "$branch" ]]; then
issue="development"
fi
db="s/^DATABASE_URL=.*/DATABASE_URL=postgresql:\/\/localhost\/phishing_$branch/"
sed -i '' $db .env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment