Imagine for a minute, you are developing a software and hardware complex, which is based on its distribution, consists of multiple servers, has a bunch of logic, and ultimately it all has to be rolled onto quite real hardware. If you let in byaku, users will not stroke you on the head. Three perennial questions pop up: what to do? how to be? and who is to blame?
Next in the text there will be a story, how to start a stable release and how it came to this. In order not to stretch the article, I will not talk about the modular, manual testing and all the stages of rolling out on productive.
It is difficult to do everything at once and correctly, especially when the end goal is not exactly known. The initial deployment at the MVP stage looked like this: no way.
make dist for i in abc ; do scp ./result.tar.gz $i:~/ ssh $i "tar -zxvf result.tar.gz" ssh $i "make -C ~/resutl install" done
The script is of course simplified utterly to convey the fact that there is no CI. From the developer's machine on an honest word, they collected and poured it on to the test environment for display. At this stage, the secret knowledge of setting up servers was in the heads of the developers and a bit in the documentation.
The problem is that there is a secret knowledge of how to fill.
Historically, teamcity has been used on many projects, and even then gitlab CI was not. Teamcity was chosen as the basis for CI on the project.
Once created a virtual machine, inside it run "tests"
make install && ./libs/run_all_tests.sh make dist make srpm rpmbuild -ba SPECS/xxx-base.spec make publish
the tests boiled down to the following:
Got better:
But feel the pain?
This scheme has lived for some time, but we are engineers for that, to solve problems and make the world a better place.
It allowed:
This scheme has lived a very long time, because in a reasonable time (30-60 minutes per build) allowed me to catch a lot of errors without bringing them to manual testing. But the sediment was that when the kernel was updated or when a package was rolled back, everything went awry, and somewhere the puppy began to feel sad.
In the course of the play, various problems appeared that would pull on a separate article:
Somewhat simplified, the final scheme turned out to be this (the non-obvious links between builds are red):
It allowed:
It is difficult to call the result obtained ideal, but on the other hand I have not met any ready-made solutions for problems of this kind. The main messages from this opus are:
UPD: Russian version
Source: https://habr.com/ru/post/342216/
All Articles