Skip to content

Instantly share code, notes, and snippets.

@GideonBrimleaf
Last active June 16, 2020 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GideonBrimleaf/fb57c60f5b10c547d0f88468d4aaa9ad to your computer and use it in GitHub Desktop.
Save GideonBrimleaf/fb57c60f5b10c547d0f88468d4aaa9ad to your computer and use it in GitHub Desktop.
Alpas migration script for small servers
#!/usr/bin/env bash
#Based off alpas.sh by ashokgelal which is available here https://gist.github.com/ashokgelal/c569e2df7e296378c8becce1c8680f31
#Include this in the root of your project - then on Heroku you can enter `heroku run ./run_prod.sh db:migrate` to run the migrations if the environment you are on is short on space
runApp() {
MY_PATH=$(dirname "$0")
MY_PATH=$( (cd "$MY_PATH" && pwd))
APP_PATH="${MY_PATH}"
export alpas_run_mode="console"
export alpas_root_dir="$APP_PATH"
#Make sure you rename app.jar to the name of your compiled jar file!
java -jar app.jar $*
unset alpas_run_mode
unset alpas_root_dir
}
if [[ $# -eq 1 ]]; then
case "$1" in
help)
runApp --help
;;
*)
runApp "$@"
;;
esac
else
runApp "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment