Skip to content

Instantly share code, notes, and snippets.

@spinolacastro
Created September 4, 2013 00:14
Show Gist options
  • Select an option

  • Save spinolacastro/6431286 to your computer and use it in GitHub Desktop.

Select an option

Save spinolacastro/6431286 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This deploy hook gets executed after dependencies are resolved and the
# build hook has been run but before the application has been started back
# up again. This script gets executed directly, so it could be python, php,
# ruby, etc.
set -e
echo "deploy"
if [ -z "$OPENSHIFT_MYSQL_DB_HOST" ]
then
echo 1>&2
echo "Could not find mysql database. Please run:" 1>&2
echo "rhc cartridge add -a $OPENSHIFT_APP_NAME -c mysql-5.1" 1>&2
echo "then make a sample commit (add whitespace somewhere) and re-push" 1>&2
echo 1>&2
fi
if [ -z "$OPENSHIFT_MYSQL_DB_HOST" ]
then
exit 5
fi
pushd ${OPENSHIFT_REPO_DIR} > /dev/null
ruby -v
echo "assets:precompile... by checkplant"
bundle exec rake db:migrate RAILS_ENV="production"
popd > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment