2 OpenShift
Matt Haley edited this page 2013-06-28 09:11:12 -07:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Installing Tracks on the Red Hat OpenShift Platform

Originally posted at http://smajnr.net/2013/05/host-tracks-v2-2-2-for-free-with-openshift.html.

An OpenShift-compatible repository of Tracks v2.2.2 is available at https://bitbucket.org/matt/tracks-openshift-quickdeploy/src. You'll need to have an account at OpenShift.com and then install the OpenShift client tools.

Installation

From a terminal or command prompt, create the application:

$ rhc app create tracks ruby-1.9 mysql-5.1

After creating the application, rhc will create a git repository in the current directory with the name of the app. We need to replace all the code with the code from https://bitbucket.org/matt/tracks-openshift-quickdeploy/src.

$ cd tracks
$ rm -rf *
$ git rm --cached *
$ git commit -m "Removing initial files"
$ git remote add upstream -m master https://bitbucket.org/matt/tracks-openshift-quickdeploy.git
$ git pull -s recursive -X theirs upstream master

Note, if youre on Windows, you might want to double check to make sure that the hook scripts are still executable. You can do this on Windows with the following:

$ git update-index --chmod=+x .openshift\action_hooks\build
$ git update-index --chmod=+x .openshift\action_hooks\deploy
$ git update-index --chmod=+x .openshift\action_hooks\post_deploy
$ git update-index --chmod=+x .openshift\action_hooks\post_start_ruby-1.9
$ git update-index --chmod=+x .openshift\action_hooks\post_stop_ruby-1.9
$ git update-index --chmod=+x .openshift\action_hooks\pre_build
$ git update-index --chmod=+x .openshift\action_hooks\pre_start_ruby-1.9
$ git update-index --chmod=+x .openshift\action_hooks\pre_stop_ruby-1.9
$ git commit

Now, you will want to edit the config/site.yml file and replace the salt: and secret_token: values with your own values. I used GRC's password generator to generate some random values. Also, while youre at it, modify any other options in site.yml that you want. Be sure to commit the changes when youre done.

Finally, we can do a push and after a while, you should be able to access your application at https://APPLICATION-NAMESPACE.rhcloud.com where youll be prompted to create the admin account and etc.

Once Red Hat resolves issues with the --from-code option to rhc, this will become much simpler.

Credit

Thanks to @disconn3ct for boiling down the necessary instructions to avoid Red Hats issues.