Skip to content

Instantly share code, notes, and snippets.

@movstox
Forked from allspiritseve/beorn
Created July 14, 2016 19:36
Show Gist options
  • Save movstox/702b87c36e6a74708b6a4d4f4ac3856a to your computer and use it in GitHub Desktop.
Save movstox/702b87c36e6a74708b6a4d4f4ac3856a to your computer and use it in GitHub Desktop.
#!/bin/bash
case "$1" in
production) environment=production; shift;;
staging) environment=staging; shift;;
* environment = staging;;
esac
case "$environment" in
staging) app=my-app-staging;;
production) app=my-app-production;;
esac
echo_exec() {
echo " -> $@"
$@
}
run() {
echo_exec "heroku run $@ --app $app"
}
case "$1" in
run) $@;;
console) run rails console;;
*)
echo "Error."
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment