Created
December 28, 2013 17:16
-
-
Save cobyism/8161691 to your computer and use it in GitHub Desktop.
Heroku utility commands
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
#!/bin/bash | |
# Run the same Heroku command on `production` and `staging` remotes, | |
# and then diff the output. | |
if [ `git remote | grep production | wc -l ` == "1" ] && \ | |
[ `git remote | grep staging | wc -l ` == "1" ]; then | |
echo "As you wish..." | |
command="" | |
for var in "$@" | |
do | |
command=$command"$var " | |
done | |
echo " -> Comparing remotes for command: heroku "$command"" | |
diff <(heroku $command--remote production) <(heroku $command--remote staging) | |
else | |
echo "Well, this is awkward. I seem to be missing either a 'production' or 'stating' remote..." | |
fi |
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
#!/bin/bash | |
# Run Heroku commands on production remote | |
if [ `git remote | grep production | wc -l ` == "1" ]; then | |
echo "As you wish..." | |
command="" | |
for var in "$@" | |
do | |
command=$command"$var " | |
done | |
echo " -> heroku "$command"--remote production" | |
heroku $command--remote production | |
else | |
echo "Well, this is awkward. I don’t know anything about a 'production' remote..." | |
fi |
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
#!/bin/bash | |
# Run Heroku commands on staging remote | |
if [ `git remote | grep staging | wc -l ` == "1" ]; then | |
echo "As you wish..." | |
command="" | |
for var in "$@" | |
do | |
command=$command"$var " | |
done | |
echo " -> heroku "$command"--remote staging" | |
heroku $command--remote staging | |
else | |
echo "Well, this is awkward. I don’t know anything about a 'staging' remote..." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment