Skip to content

Instantly share code, notes, and snippets.

@frankpinto
Created July 18, 2014 17:22
Wrapper script used to run sql scripts across environments
#!/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