To manage openshift apps we'll be using rhc.
Follow the first 3 steps from here
rhc app create YOUR_APP_NAME http://cartreflect-claytondev.rhcloud.com/reflect?github=openshift-cartridges/advanced-ruby-cartridgerhc cartridge add mongodb-2.4 -a YOUR_APP_NAMERockMongo is similar to PhpMyAdmin but for MongoDB
rhc cartridge add rockmongo -a YOUR_APP_NAMENote the username/password that are generated
( by default it uses Passenger )
rhc env set OPENSHIFT_RUBY_SERVER=puma -a YOUR_APP_NAME
available options are passenger, puma, unicorn and thin. ( Gemfile should contain the gem of that server )
The folder YOUR_APP_NAME is not needed anymore, you can go ahead and delete it.
-
Clone the source repo from github (let's say the folder that contains the source is
SOURCE_FOLDER -
cd SOURCE_FOLDER/ -
Now we need to add a remote to this git repo that should point to the git repo of openshift app
# git url is given after creating application ( rhc app create … ), or you can get it by running rhc apps
git remote add openshift GIT_URL
git push openshift master -fYou can check which server is currently running by using this command
rhc ssh YOUR_APP_NAME '~/advanced-ruby/bin/control server'To take effect, the application must be restated or you must deploy your code again.
rhc app restart YOUR_APP_NAMEFor more info, refer