OpenShift is Red Hat's auto-scaling PaaS for web applications. Similar to wercker, OpenShift allows developers to focus on their code and not on the management of their stack and infrastructure. You can sign up for OpenShift for free.
Wercker helps you streamline your continuous delivery pipeline to OpenShift, thus reducing risk and eliminating waste in your workflow and increasing developer velocity. Signing up for wercker is easy and free.
Alongside integrating with OpenShift, Wercker is now also a developer partner.
Getting started with wercker and OpenShift
In this post we're outlining how to get started with wercker and OpenShift. For your convenience, we've created a sample application in Ruby on GitHub that you can fork to get started with OpenShift and wercker. OpenShift offers several application quickstarts that you can view. Keep in mind that wercker currently supports Node.js, Ruby, and Python but more stacks are coming soon!
This guide is also available in short form on our dev center.
- OpenShift credentials (sign up at OpenShift registration page)
- You have created an application in OpenShift
- A GitHub or Bitbucket account with a pre-made repository
- You have registered for a wercker account and signed in
- You have added your application to wercker
Every successful build on wercker can be deployed to a so-called deploy target. This can be a custom deploy target, or one of the predefined targets like Heroku or OpenShift. You can read more at the deployment section.
In this article we will add one for OpenShift. Follow along with the steps below:
Navigate to your application
First we need to sign in at wercker and navigate to the application we would like to deploy to OpenShift.
Add OpenShift deploy target
To start the process to add an OpenShift deployment target, do the following:
- Click on the
Deploymenttab to open it
- Click the
Add deploy targetdropdown
Create OpenShift authentication token
note: you can skip this step if you already have an OpenShift authentication token.
OpenShift allows other services, like wercker, to access information via a secret token. OpenShift has three different scopes:
userinfo. Wercker needs only read access. Although you can use an existing authentication token we strongly advise you to create one per service. You can create a
read authorization key at the add authorization page at OpenShift. Give it a meaningful name like
Enter the OpenShift authorization token and click
Enter OpenShift deploy target details
Enter a descriptive deploy target name, such as: staging or production.
Select the OpenShift domain and application that you want to deploy to. Wercker automatically selected the first available domain and application.
If there are no domains or applications listed, please make sure you've created them on OpenShift.
save to create the deploy target.
note: you can learn more about OpenShift domains and application in the Namespaces chapter of the OpenShift User Guide.
Add public key to OpenShift
Wercker generates a ssh key per deploy target which is used to securely encrypt the connection that is used to deploy to OpenShift. This key needs to be added to the public keys section at OpenShift.
Copy the full content of the public key from the second textbox.
Login to OpenShift and add the key to your public key list.
You are now ready to deploy to OpenShift. Wercker allows you to deploy all succesful builds. Navigate to your application and select the succesful build you would like to deploy.
In the build via click the
deploy this build button and choose the target that you have just created.
Congratulations! You have succesfully deployed your application to OpenShift.
You can share the build status of your application via the wercker badge (for instance in the README.md of your application on GitHub) that you can add via the 'share button', just below the application header:
This is the build status of my application on wercker:
If you want to invite team members to your application, you can do so via the settings tab. Keep in mind that the team members you want to invite have to have a wercker account - they can register on our sign up page.
Thanks for following along and you can view the final application on wercker