This git repository helps you easily integrate Travis CI into your OpenShift apps.
Once you've created the quickstart, you'll need to create a Travis CI account and add your authorization information to your Git repository. Making code changes will require you to set a public SSH key, and then to clone your new application Git repository onto your local machine. See the Getting Started page for more steps in this flow.
This is a sample OpenShift application that illustrates integration with open source continuous integration system, Travis CI.
rhc app create creates a local working copy in
We will work in that copy:
This copy has a git remote pointing to your OpenShift gear, so it is a good idea to rename it before going further:
git remote rename origin openshift
Next, create a new repository on Github. The name can be anything, but for the purpose of illustration, we call it
Finally, add a remote pointing to Github:
git remote add origin https://github.com/<USER>/myapp.git
And push code:
git push -u origin master
Next, visit Travis profile page and locate your new application
myapp and enable Travis integration.
If you do not see it, press "Sync now" button near the top of the page.
This quickstart has a near-empty
.travis.yml (more on this below). After running
bundle install to install dependencies, run
travis to populate the
$ travis setup openshift OpenShift user: firstname.lastname@example.org OpenShift password: ************ OpenShift application name: |myapp| OpenShift domain: openshiftdomain Deploy only from <USER>/myapp? |yes| Encrypt password? |yes|
The default build script for a Ruby application on Travis is
rake. This is not applicable for this simple application, so we override this with a simple
true script that succeeds every time.
Finally, it is time to deploy to Github. This will trigger a build on Travis, which in turn pushes code to your OpenShift gear on your behalf using the credentials given in
git add .travis.yml git commit -m 'Set up Travis build' git push origin master
Since the deployment to your OpenShift gear will be initiated by Travis, you will not see the deployment result from the
git push above. You can check the status with Travis, or you can run:
travis logs -r <USER>/myapp