A word about Travis CI = Travis
©Travis CI, GmbH stands for the company from Berlin that created Travis the continuous integration tool. They choose Ruby programming language for the project.
Travis is a cloud-based service that can test public projects hosted on GitHub for free, and for the non public projects, there is a certain fee involved.
There is also a TravisPro providing custom deployments on customer’s own hardware.
We said Travis is continuous integration service. How continuous? This depends on Travis detecting development system updates frequency. Once the update has been detected Travis build will start.
This may happen by checking every n-minutes, or by detecting the change, usually after pushing to the GitHub master branch ( this was the /trunk in Subversion ).
The continuous integration service will try to build the entire product. If there is anything to compile, it will try to compile, then it will start the unit test, do integration tests, do the quality analysis…
Travis is report oriented. The report may be a success or a failure, and you can receive it via email, or via Slack, Twitter, … You can actually customize that part completely.
The main Travis logic is inside the .travis.yml file.
Here is the example .travis.yml file.
The upper Travis file is for the Twentyseventeen WordPress theme with a plethora of Linux command lines that will be executed inside the Travis cloud container once the Travis build starts.
It is important to understand the Linux command line when testing using Travis.
Here is the list of all the possible Travis config file hooks.
apt addons before_install install before_script script after_success or after_failure before_deploy # optional deploy # optional after_deploy # optional after_script
Travis CI uses virtual machine snapshotting to make sure no state is preserved between builds. If you modify CI environment by writing something to a data store, creating files or installing a package via apt, it does not affect subsequent builds.
At the end do not forget the that it is not bad if someone’s code breaks the night build, this is actually a step forward resolving and improving the code.