📜 ⬆️ ⬇️

What is travis-ci.org and what is it eaten with?

image

Surely everyone heard the hype around the project travis-ci.org . I am not an exception and considering that one of its developers, Josh Kalderimis (Josh Kalderimis) , speaking at the last conference of toster.ru , kindled my interest even more, I decided to finally figure out what travis-ci is and what it is eaten with. . After reading, you will learn how this service can help ruby ​​developers, as well as how they can help. Sit back, let's start ...

Continuous integration


As it turned out, the term “continuous integration” is quite old. It was introduced by Martin Fowler in the year 2000 and is described in the article “Continuous Integration” and in Russian sounds like “continuous integration”. This is part of the development process in which a project under development is assembled / tested in various execution environments automatically and continuously. This technique was conceived for the most rapid identification of errors / contradictions of the project integration, and, accordingly, reduction of costs for subsequent downtime.
')
The principle is quite simple: a separate service runs on a separate machine, whose responsibilities include obtaining the source code of the project, its assembly, testing, logging, and the ability to provide for analysis data on the performance of the listed operations.

Of course, free cheese happens only in a mousetrap and you have to pay for convenience: select a separate server and maintain it in working condition, ensure the availability of the necessary software, set up the runtime environment, make backup copies of data, etc. All this requires a lot of time and resources. And it seems quite logical to be able to delegate this responsibility to third-party services. That's exactly what travis-ci is, “hosting continuous integration for the open source community.” It's time to take a closer look at it.

Technical side


Travis-ci supports many programming languages, including ruby ​​(which is not surprising, since it was originally developed for ruby ​​projects). Start using the service is very simple. You just need to take a few steps, which are described in detail in their own guide of the project. I will only describe the process as a whole.

Connect


Travis-ci works with the github.com service, so the first thing you need to do is put the source code of your project there. Except for minor technical settings (such as installing hooks in the repository), the whole process comes down to describing various options in the .travis.yml file. It needs to describe in what language the project works, what versions of the language you need to use (you can use everything at once), the environment ( here is an example of such a file for ruby). This file must be placed in the root of the github repository.

If the setting was successful, then travis-ci starts to continuously test the project, displaying the current status: red (problems occurred during testing), yellow (there are warnings) and green (all tests passed successfully). In addition to the status, you can see: an error message or a warning if something went wrong; last commit and its author; build history, etc. In general, the interface is quite informative and understandable. In addition, travis-ci will notify you of problems by email.

Features of the service


  1. At the moment when the .travis.yml file falls into the root of the github repository, work begins only when any one processor (worker) for the project language is released.
  2. All active project brunches in which the .travis.yml file is present are tested.
  3. The state of the software environment between builds is not saved. This means that if during the testing process the database was changed, any files were created, etc., then in subsequent assemblies these results will not be available. Each new build begins with a clean slate.
  4. In order not to make mistakes in the .travis.yml file, there is the utility travis-lint . She can check:
    • Are there any inconsistencies in the YAML format
    • Key language specified
    • Does travis-ci support specified runtimes
    • The file does not use outdated functions.

  5. For maximum efficiency, so-called. assembly matrix This means that when specifying multiple execution environments, environment variables, etc. in one file, the chain of all possible combinations that will be used for assemblies will be automatically lined up. For the example below, four assemblies will be executed:

#.travis.yml rvm: - 1.9.3 - rbx-18mode env: - FOO=foo BAR=bar - FOO=bar BAR=foo 


Interesting Facts


  1. “Travis” in the name of the service means the name of the cartoon character - Travis tractor, from the children's TV show “Bob The Builder” .
  2. To encourage the public to help the project financially, the authors created the site love.travis-ci.org , where you can donate a certain amount for support and depending on the amount of the sum, the authors will present various souvenirs in response: stickers, ringtones and so on. It is also interesting that on the same site some plans for the future are described, including on monetization.

Conclusion


Travis-ci, by the will — not by will, arouses interest to itself Considering the fact that at the moment it hosts quite large and well-known projects, there is a demand for such services. The service is only gaining momentum and I would like to wish him to gain a large community of users.

Links


  1. Service site
  2. Service Documentation
  3. Profile on github.com
  4. Josh Calderimis Twitter
  5. Twitter Sven Fuchs
  6. Article by Martin Fowler "Continuous Integration"

Source: https://habr.com/ru/post/140344/


All Articles