And we will build our own CI with conan and travis
Introduction
Developers’ mind has a common opinion, about their work which become completed after they’ve committed the code, and what happens next – not their problem. There is a great quote by Robert Highline for that thesis:
Each person should know how to change diapers, plan the invasion, harvest a pig, construct buildings, control a ship, write sonnets, make financial reports, build walls, set bones, assist dying, carry out an order, give out orders, cooperate, act alone, solve equations, analyze new problems, fertilize plants, program computers, cook tasty food, fight with dignity, die with dignity.
Specialization is the destiny of insects.
And instead of the opinion mentioned above, will put out our own thesis - the fact that code compilates on the developer’s environment and developer’s personal machine is not interesting for anyone! Our goal - Ii to make another step to the continuous integration, automate dependency resolution, assembling and unit testing for all the platforms which are interesting for us.
Continuous Integration
Continuous integration is the kind of practice, according to which, developers periodically (you can read it as daily) put out the results of the work into the main code branch. First use of that practice was introduced in the Buch method. Later, at extreme programming methodology, it improved with automatic unit tests run. Next step of current practice development is Continuous Delivery - the process where the distributive is created, after all acceptance tests are successfully completed, the distributive which ready to be published to the customer. And at the very end we can speak about Continuous Deployment during which all the changes that passed the testing phase successfully, automatically deployed to production. If you are already confused, you can imagine the following sequence:
1. Continuous integration
2. Continuous delivery
3. Continuous deployment
At the course of the current master-class we will speak about CI in the scope of C++ development.
Preliminary requirements
What is required from you:
- experience in using C++ (thanks, Cap!)
- laptop with any OS installed
- one of the compilers (Visual Studio >= 2015 / g++ >= 5.4 / clang++ >= 3.9 / Xcode >= 8.0)
- cmake >= 3.6 (you need to understand the syntax of CMakeLists.txt)
- git >= 2.10
- python >= 3.5
- pip3 >= 9.0
- github.com account
- travis-ci.org account (linked to github)
- appveyor.com account (linked to github)
- conan.io account
- digitalocean.com account
Part One - github
In the first part, we will assume that you are creating a personal home project, work on Open Source project or can store source files on some external resource, and ready to pay for it.
What tasks you will be able to solve:
- understand how to automate assembling for Linux and Mac OS with Travis-CI
- understand how to automate assembling for Windows with the help of appveyor
- understand how to manage dependencies with the help of conan
- understand how to automate unit tests runs for all the platforms
- understand how automatically deploy with different configurations different compiler versions
- understand how to create your own packets for conan (first step towards CD)
Part Two - self hosted gitlab
During the second part we’l’ look at the situation when your working project has closed source code, and you don't want to have strong dependency for vendor lock infrastructure.
What tasks you will be able to solve:
- how to deploy gitlab at digitalocean fast(DO)
- how to configure gitlab CI for your project
Conclusion