Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Heroku utility commands
#!/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
#!/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
#!/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
You can’t perform that action at this time.