Note: the code samples may be displayed improperly because of markdown. I recommend to continue reading the original article on our blog to make sure all the examples are displayed properly.
Continuous Integration (CI) is a software development practice that is based on a frequent integration of the code into a shared repository. Each check-in is then verified by an automated build.
The main goal of continuous integration is to identify the problems that may occur during the development process earlier and more easily. If you integrate regularly — there is much less to check while looking for errors. That results in less time spent for debugging and more time for adding features. There is also an option to set up inspection of the code style, cyclomatic complexity (low complexity makes the testing process more simple) and other checks. That helps to minimize the efforts of the person responsible for the code review, saves time, and improves the quality of the code
Now, when the process of continuous integration is clear (I hope so) we can move to the comparison of some of the most popular CI platforms nowadays. Each of those has its pros and cons. Let’s start with CircleCI.
Features :
CircleCI is compatible with:
CircleCI Pros:
CircleCI Cons:
Go (Golang), Haskell, Java, PHP, Python, Ruby/Rails, Scala
Travis CI and CircleCI are almost the same
Both of them:
What does TravisCI offer that CircleCI doesn’t?
Android, C, C#, C++, Clojure, Crystal, D, Dart, Erlang, Elixir, F#, Go, Groovy, Haskell, Haxe, Java, JavaScript (with Node.js), Julia, Objective-C, Perl, Perl6, PHP, Python, R, Ruby, Rust, Scala, Smalltalk, Visual Basic
language: python python: - "2.7" - "3.4" - "3.5"env: - DJANGO='django>=1.8,<1.9' - DJANGO='django>=1.9,<1.10' - DJANGO='django>=1.10,<1.11' - DJANGO='https://github.com/django/django/archive/master.tar.gz'matrix: allow_failures: - env: DJANGO='https://github.com/django/django/archive/master.tar.gz'
Build matrix is a tool that gives an opportunity to run tests with different versions of language and packages. You may customize it in different ways. For example, fails of some environments can trigger notifications but don’t fail all the build ( that’s helpful for development versions of packages)
Merging Django ORM with SQLAlchemy for Easier Data Analysis_Django development of products is usually easy and straightforward: great documentation, many tools out of the box…_djangostars.com
Django Performance Optimization Tips_I frequently face a recurring situation when developers receive a task to make a performance optimization on Django…_djangostars.com
In case you prefer any other CI platform — there is always an option to create a Build Matrix by using Tox.
[tox]envlist = py{27,34,35}-django{18,19,110,master}
[testenv]deps = py{27,34,35}: -rrequirements/test.txt django18: Django>=1.8,<1.9 django19: Django>=1.9,<1.10 django110: Django>=1.10,<1.11 djangomaster: https://github.com/django/django/archive/master.tar.gzcommands = ./runtests.py
[testenv:py27-djangomaster]ignore_outcome = True
Tox is a generic virtualenv management and test command line tool. You may install it by using pip install tox or easy_install tox command.
Travis CI Pros:
Travis CI Cons:
Features:
Jenkins Pros:
Jenkins Cons:
What CI system to chose? That depends on your needs and the way you are planning to use it.
CircleCI is recommended for small projects, where the main goal is to start the integration as fast as possible.
Travis CI is recommended for cases when you are working on the open-source projects, that should be tested in different environments.
Jenkins is recommended for the big projects, where you need a lot of customizations that can be done by usage of various plugins. You may change almost everything here, still this process may take a while. If you are planning the quickest start with the CI system Jenkins might not be your choice.
Which CI system do you prefer? Leave us a comment to share your thoughts.
You are always welcome to ask questions and share topics you want to read about!
The article is written by Oleksandr Shaporda (ALEXANDER SHAPORDA) — a PR Manager at Django Stars. This article about continuous integration is originally published on Django Stars blog.
Specially shared with Hackernoon readers.
If you find this post useful, please tap 👏 button below :)