Codeship is a hosted continuous integration (CI) server. Using the Rainforest CLI, it's very easy to configure CodeShip to run your Rainforest test suite after each deploy.
We built a sample project on Github to show how we integrate with various CI tools, including Code Ship.
Our project is configured to provide a continuous delivery flow by default. Here's how it works!
- Run the automated tests
- Install the rainforest-cli gem
- Deploy the 'develop' branch to a staging server
- Run the rainforest tests using the rainforest-cli gem against the staging server
If any of the above steps fail, the whole build fails, preventing the deployment of broken code to your users.
Getting Started With CodeShip
We'll cover some important items next, but for the full picture we encourage you to consult the excellent Codeship documentation.
Configuring Your CodeShip Project
You must use the CodeShip web interface to configure your build. The first step to get CodeShip to work with rainforest is to install the rainforest-cli gem in the setup part of the configuration.
You simply need to add the line "gem install rainforest-cli" in the setup section.
We now need to tell CodeShip what is our Rainforest API token to trigger the Rainforest run.
To configure environment variables, you can do so in the project's settings. You can find your Rainforest API token in the settings pane of your account. You can then create a RAINFOREST_TOKEN variable in CodeShip and you're done.
Then the next step is to configure your deployment process to your staging server. In our example, we're using Heroku, but please refer to the CodeShip documentation if you're using a different hosting provider.
Testing your setup
You can test your setup by committing a change to your develop branch and pushing it your git repository. CodeShip should pick up on the change and deploy your code.
You now have a continuous delivery flow + amazing QA and can consider yourself in the cool kids club.