Fork me on GitHub

Continuous Integration

Continuous integration (CI) automates building, testing and deploying applications.

Why is continuous integration important?

When CI is set up well it can dramatically reduce deployment times by eliminating manual steps and ensure code does not have bugs that are being checked by automated tests. Source code changes as a project evolves. CI combined with unit and integration tests check that code modifications do not break existing tests ensure the software works as intended.

Continuous integration example

The following picture represents a high level perspective on how continuous integration and deployment can work.

One potential way for continuous integration to work.

In the above diagram, when new code is commited to a source repository there is a hook that notifies the continuous integration server that new code needs to be built (the continuous integration server could also poll the source code repository if a notification is not possible).

The continuous integration server pulls the code to build and test it. If all tests pass, the continuous integration server begins the deployment process. The new code is pulled down to the server where the deployment is taking place. Finally the deployment process is completed via restarting services and related deployment activities.

There are many other ways a continuous integration server and its deployments can be structured. The above was just one example of a relatively simple set up.

Open source CI projects

Hosted CI services

  • Travis CI provides free CI for open source projects and has a commercial version for private repositories.

  • Bamboo is Atlassian's hosted continuous integration that is also free for open source projects.

  • Circle CI works with open or closed source projects on GitHub and can deploy them to Heroku if builds are successful.

  • Shippable uses Docker containers to speed the build and integration process. It's free for public repositories.

  • Drone is another CI service that also provides free builds for open source projects.

  • Codeship provides continuous integration for Python 2.7.

  • Snap is a CI server and build pipeline tool for both integrating and deploying code.

Continuous integration resources

What do you want to add to your application next?

How do I log events that happen in my app while it is running?

What should I do to secure my web application?

How do I integrate external APIs into my application?


Interested in a complete Full Stack Python book with detailed tutorials and example code? Sign up here and you'll get an alert email if a book is created. No other emails will be sent other than sign up confirmation.