Editor's note: Paul Biggar is CEO at CircleCI. He is a Y Combinator alumnus and holds a PhD in Computer Science with a focus on static analysis of scripting languages.
Why Continuous Integration is useful
Continuous Integration, and its cousin, Continuous Delivery, are some of the best ways to increase the productivity of your dev team. As well as reducing project risk, a more productive team is happier, and leads to happier customers too. Developers are unhappy when they're not shipping code. A slow development cycle saps their energy, damages their morale, and removes the joy of a job well done. They feel worse, they enjoy their job less, and their performance suffers even more. Continuous Integration provides the ability to move quickly. When failing tests creep into a code base, developers waste time hunting them down. Those failing test also make people ignore the test suite, leading to site unreliability. CI prevents this. By creating an automated process for code shipping to customers, Continuous Delivery also makes developers more productive, and happy to see their code ship as soon as possible. Naturally, this delights customers too: imagine if a customer tells you about a bug, only to see it fixed 10 minutes later. Contrast this to a customer who sees their bug still hasn't been fixed after two weeks: much less delightful. <!--more-->
The birth of CircleCI
How to get up and running
Runnning your tests
We designed CircleCI to be really easy to set up. Our hosted build infrastructure allows you to test a wide variety of projects. We support dozens of versions of Ruby, Python, Node and PHP, along with Java, Go, Clojure, Scala, C and C++. We also support dozens of DBs and queues, from Postgres to Couch, and browsers and headless browserslike, Chrome, Firefox, PhantomJS, and others. We integrate tightly with GitHub, so once you approve and select a project we can automatcally test every push and Pull Request. Our setup algorithms will automatically detect how to run your code by inspecting it, and can start to test within 10s of signing up.
- Visit https://circleci.com
- Click signup, which takes you to the GitHub permissions page
- Approve the permissions on GitHub
- Select a project to test from the list
With those steps, your first test will begin to run in real-time.
In some cases, your project might not be so easy to infer, or might fail because it needs a custom step. We have a simple process to fix that: add a circle.yml file to your repo that allows you customize any part of the build (you can also tweak it from our UI, if you don't want to change your repo). You can run extra commands, start services or daemons, install new libraries or set up deployment. You can also split your tests across multiple machines; if you have a long test suite, you can run it up to 64x faster!
Deploying to Heroku
To take advantage of Contiunous Delivery, you can set CircleCI up to automatically deploy your code, if it passes tests on the master branch. You may wish to deploy to a staging branch first, or to deploy directly to customers. Either one is possible on CircleCI. We support many different deployment targets, and have customers deploying to Heroku, Engineyard, AWS, DotCloud, and many others
We'll focus on Heroku here:
From your project page on CircleCI, choose Edit settings > Heroku settings and do the following:
- Add a Heroku API key; this allows CircleCI create a Heroku deploy key
- Appoint yourself as the Heroku Deploy User (this tells us to deploy this project as you)
- Add deployment settings to your circle.yml file. For example
deployment: staging: branch: master heroku: appname: mystagingapp
After this setup, we'll deploy to your application (in this case "mystagingapp") every time your tests pass on the master branch. You can also set up more complicated commands to deploy to Heroku or for any other deployment (check out our documentation for more details).
It's easy to get started, try it now at https://circleci.com.