Skip to content

Instantly share code, notes, and snippets.

@bbrowning
Last active December 20, 2015 23:49
Show Gist options
  • Save bbrowning/6215393 to your computer and use it in GitHub Desktop.
Save bbrowning/6215393 to your computer and use it in GitHub Desktop.
OpenShift pre_build hook to allow Windows developers to deploy to OpenShift
  1. Make sure your Gemfile.lock is not committed to your OpenShift git repository.

  2. Copy the pre_build file to .openshift/action_hooks/pre_build

  3. Add .openshift/action_hooks/pre_build to git, set the executable bit, and push your changes

    git add .openshift/action_hooks/pre_build git update-index --chmod=+x .openshift/action_hooks/pre_build git commit -m "Add bundle_install in pre_build hook" git push

#!/bin/bash
source "${OPENSHIFT_RUBY_DIR}/lib/ruby_context"
pushd ${OPENSHIFT_REPO_DIR} 1> /dev/null
SAVED_GIT_DIR=$GIT_DIR
unset GIT_DIR
ruby_context "bundle install"
export GIT_DIR=$SAVED_GIT_DIR
popd 1> /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment