From a2f2f630a495c4a727a352a3ad19ae6c87959d8b Mon Sep 17 00:00:00 2001 From: Graham Kaplan Date: Sat, 17 May 2014 13:34:42 -0700 Subject: [PATCH 1/2] Add OpenShift hooks --- .gitignore | 3 ++- .openshift/action_hooks/start | 7 +++++++ .openshift/action_hooks/stop | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .openshift/action_hooks/start create mode 100644 .openshift/action_hooks/stop diff --git a/.gitignore b/.gitignore index 0598de0..f176882 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ !.rspec !.slugignore !.travis.yml +!.openshift *~ @@ -66,4 +67,4 @@ brakeman.html # Ignore sensitive data /config/settings/local.rb -/nbproject/private/ \ No newline at end of file +/nbproject/private/ diff --git a/.openshift/action_hooks/start b/.openshift/action_hooks/start new file mode 100644 index 0000000..a2c8532 --- /dev/null +++ b/.openshift/action_hooks/start @@ -0,0 +1,7 @@ +#!/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 +export PATH=$OPENSHIFT_RUNTIME_DIR/bin:$PATH +cd $OPENSHIFT_REPO_DIR +rails server -b $OPENSHIFT_INTERNAL_IP -p $OPENSHIFT_INTERNAL_PORT -d diff --git a/.openshift/action_hooks/stop b/.openshift/action_hooks/stop new file mode 100644 index 0000000..259cea5 --- /dev/null +++ b/.openshift/action_hooks/stop @@ -0,0 +1,4 @@ +#!/bin/bash +# The logic to stop your application should be put in this script. +kill -9 `ps -ef | grep "rails server" | grep -v grep | awk '{ print $2 }'` > /dev/null 2>&1 +exit 0 From 3d9650f53147dba34162c71a5974fbf93c8474b8 Mon Sep 17 00:00:00 2001 From: Graham Kaplan Date: Sat, 17 May 2014 16:31:10 -0700 Subject: [PATCH 2/2] Fix gemfile for openshift --- Gemfile | 2 +- Gemfile.lock | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 99b4411..38b1f01 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'http://rubygems.org' -ruby '2.0.0' +#ruby '2.0.0' gem 'rails', '4.0.0' # Servers diff --git a/Gemfile.lock b/Gemfile.lock index 668a72e..d339bb0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -337,7 +337,6 @@ GEM json (>= 1.8.0) unicode_utils (1.4.0) uniform_notifier (1.4.0) - wdm (0.1.0) webmock (1.17.4) addressable (>= 2.2.7) crack (>= 0.3.2) @@ -401,5 +400,4 @@ DEPENDENCIES simplecov sorcery (>= 0.8.1) uglifier (>= 1.3.0) - wdm (>= 0.1.0) webmock