Created
July 18, 2014 17:22
-
-
Save frankpinto/3427cf769a72ef25ffac to your computer and use it in GitHub Desktop.
Wrapper script used to run sql scripts across environments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ $ENVIRONMENT = 'development' ]; then | |
psql ayalo_dev postgres < script.sql; | |
elif [ $ENVIRONMENT = 'beta' ]; then | |
PGPASSWORD=scrubbed psql -h scrubbed --port 5432 ayalo_dev postgres < script.sql | |
elif [ $ENVIRONMENT = 'production' ]; then | |
PGPASSWORD=scrubbed psql -h scrubbed --port 5492 scrubbed scrubbed < script.sql | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment