Skip to content

Instantly share code, notes, and snippets.

@ordnungswidrig
Created June 6, 2012 11:30
Show Gist options
  • Save ordnungswidrig/2881373 to your computer and use it in GitHub Desktop.
Save ordnungswidrig/2881373 to your computer and use it in GitHub Desktop.
Openshift start and stop hook for leiningen
#!/bin/bash
# The logic to start up your application should be put in this
# script. The application will work only if it binds to
# $OPENSHIFT_INTERNAL_IP:8080
# save as .openshift/action_hooks/start
export HTTP_CLIENT="wget --no-check-certificate -O"
export PORT=$OPENSHIFT_INTERNAL_PORT
export HOST=$OPENSHIFT_INTERNAL_IP
export HOME=$OPENSHIFT_DATA_DIR/home
export LEIN_JVM_OPTS=-Duser.home=$HOME
cd $OPENSHIFT_REPO_DIR
$OPENSHIFT_REPO_DIR/bin/lein run >${OPENSHIFT_LOG_DIR}/lein.log 2>&1 &
disown
#!/bin/bash
# The logic to stop your application should be put in this script.
# save as .openshift/action_hooks/stop
kill `ps -ef | grep lein | grep -v grep | awk '{ print $2 }'` > /dev/null 2>&1
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment