D
D
Daniil Muidinov2015-11-25 14:44:29
PHP
Daniil Muidinov, 2015-11-25 14:44:29

Where does CI start?

There is a small startup, a PHP + MySQL project
3 developers
1 admin
Team distributed
3 cheapest machines in the DigitalOcean cloud
1. Zabbix
2. Nginx + PHP-FPM + Redis (php sessions)
3. MySQL + Sphinx
Now development is going this way
Every programmer codes on his laptop in a notepad convenient for him (far, xcode, notepad ++), copies files to a server with a test domain then, at some point, we more or less fix the version, make a copy of the working server, and transfer changes from the test server to it
Without instrumental funds!
in general, complete obscurantism
I want to start integrating gitlab in order to get version control, a tool for automated deployment to a test environment, and also create some rules for deploying a project to a production version. Auto testing will be added in the future. In general, you need to establish a normal development life cycle.
But the question is, where do you start doing it?
How to make it so that it is convenient for developers?
How to carry out this integration as painlessly and transparently for them as possible?
What does the development life cycle look like for such a small project so far using the tools described above?
Share your experience in implementing such tools and how this "life cycle" looks like for you.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Alexander Kubintsev, 2015-11-25
@akubintsev

CI is an automated version control based project build and test run.
Actually, you need to start with the task of implementing the deployment.
Deploy to make - the task is not trivial. There are different tools for this and there is no universal solution. You need to debug the deployment procedure for builds in CI and for production / stage. Personally, I chose deploybot.com
for my last small project to put into production - in principle, everything you need is there, including good integration with DigitalOcean. As for the CI tool, the free ones are usually Jenkins. I tried PHP CI on a recent project - also good, but not as flexible.
The layout for production / stage can be configured in different ways. For example, by committing to a special branch, by keywords in a commit, or even manually. On prod it is definitely worth doing the calculation manually.
Oh, and one more important point. For the successful functioning of this whole thing, you need to implement versioning of the database schema and fixtures (for CI).
Our life cycle was like this. The team leader defines a small, but not very small set of features that should be included in the new version of the application. All tickets are associated with versions. And therefore, it may happen that even a finished feature will be defined in a different version of the product.
Each version that is being prepared for release receives its own branch in git and merges the necessary commits with features there. Each commit is automatically tested in CI.
When all the features are done and the commits are merged, then you can upload to the stage server and drive the live version in conditions close to combat. And finally, if everything is fine, then a deployment is made to production.

M
Max, 2015-11-25
@MaxDukov

definitely start with GIT. and I strongly advise you to look at the article about the branching model in git - so as not to reinvent the wheel.

P
Pavel Shorokhov, 2015-12-04
@comm1x

To implement CI, the sequence is quite simple:
1. VCS. Implement git first, not necessarily the complexity of gitlab. For 3 people, a private repository on bitbucket is enough.
2. Acceptance tests. We take a testing framework (I love Codeception, but there are many others), and write a couple of acceptance tests for critical parts (payment, registration, etc.).
3. Unit tests. Cover the main parts of the project with unit tests (5-10% code coverage is enough for the first iteration).
4. We automate. We decide on CI, set it up, set up repository hooks and notifications about success/fail builds via developer mail.
Briefly, it can be described as follows: there must be a git, and there must be tests.
Now, continuous deployment is a stone's throw away. Most likely, when you get to this, you will already have an idea of ​​\u200b\u200bhow best to organize this process, because there are a lot of options here. Starting from self-written deployment scripts and ready-made deploy software such as Capistrano, ending with deployment and replacement of backends and change of docker containers.

R
rutaka nashimo, 2015-11-25
@rutaka_n

jenkins-ci

M
Max Sysoev, 2015-12-03
@ColCh

Gitlab CI is very good and pretty easy to learn. And it's also free! If you have a Gitlab account, then you can already start using Gitlab CI.

V
v- death, 2015-11-25
@vGrabko99

Cool programmers you have that they don’t know how it’s more convenient to make versioning. And instead of sessions, use jwt.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question