A
A
Alexey So2017-02-22 10:10:39
git
Alexey So, 2017-02-22 10:10:39

How to set up deploy in Gitlab? What version is needed?

Good afternoon.
I would like to set up the following scheme: there is a repository on gitlab (several people work in it from local servers). There is a test server for demonstration to the customer. There is a production server.
I would like to automatically send everything to a test or production server after a merge request.
Now I have to merge myself - and upload to production git pull.
I saw this during development, but I did not set it up myself.
If I understand correctly, then these are pipelines?
Is there a proper setup manual?
I would be grateful if someone writes step by step, with the repository settings on the server. (which and how to make external links)? Now we are working with git via ssh.
Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Sharapov, 2017-02-22
@SicYar

https://habrahabr.ru/company/softmart/blog/310502/
Maybe this will help you.

R
Ruslan, 2017-02-22
@BaRoN

I would advise you to get yourself some kind of service for Continous Integration, for example Jenkins.
It will allow you to complicate the task a little (who would have thought that complicating is something good!), for example:
* Monitors git / svn / hg / whatever for a new version * Pulls
a new version
* Runs tests
* In case of tests failing sends a push / email to the offending developer
* In the case of tests, it performs a deployment, and / or, for example, sends an artifact to the repository, or a docker image to the repository.
For a small project of 5 files, of course, Jenkins is out of the question, and rsync (if applicable) will probably be better here. But the larger the project and the more tests and build options, the more useful Jenkins can be.
As soon as we don’t use it: it collects docker images (in case of successful build and tests - to the repository), and collects java-artifacts (similarly, it was assembled - went to maven). It collects applications on spring-boot, copies them to the target server, makes a service out of them and restarts it itself.
Yes, a lot can be attributed to hooks, but:
* Hooks are executed on the developer's computer (and why do I need to run 300 tests on each commit if there is a specially trained server nearby?). In addition, there have been situations when something is collected on the developer's computer just because he has some local hacks. And then a new person comes (or he changes the computer) and for two days he does nothing but set up everything for himself :). This does not happen with a separate collector.
* Deploy and redeploy can be run by a specially trained PM, not by a developer. Or anyone at all.
* There are all sorts of beautiful graphs that more and more successful tests are being performed, for example. At any time, PM can see what changes were in each specific build.
I saw all sorts of different configurations, even one when a virtual machine was bought on amazon to build the project, did the assembly and was destroyed :) The only question is the perversion of the consciousness of the Jenkins administrator. And, of course, it is most well integrated with Java. JetBrains TeamCity, Atlassian Bamboo - in general, too.

A
Arthur, 2017-03-02
@ArturF

As mentioned above, you can use Jenkins. At one time we used it a little, but in the end we came to the built-in Gitlab CI.
You don't need to install Gitlab CI separately, it comes with Gitlab itself. Additionally, you will need to install a runner - one or more, depending on your goals (for example, one SSH runner may be enough for a simple deployment).
On their blog they have articles on the subject that show the process in general terms:
https://about.gitlab.com/2016/08/26/ci-deployment-...
https://about.gitlab.com /2016/08/05/continuous-int...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question