Suppose there is a project in gitlab'e - test.git . In the development process, the merzhrekvesty come, and after merge to the master, I want to roll out the release on production. To do this, I go to the server and execute the following command there:

git archive --remote=/git-data/repositories/root/test.git master | tar -x -C /sites/test/

But, is it possible to do this from gitlab, in order not to go to the server? And for example, in my case, this is a project on node.js, and after the git archive command is executed, I would also like to restart the node /sites/test/restart.js --use_strict .

ps read about builds but didn’t understand how it works, please explain in more detail how it works and how to solve my problem.

  • one
    Here is a solution for you? ru.stackoverflow.com/a/428514/181472 In general, storing the repository on your battle server is dangerous. Too easy to clean source code. And you can make a package and pull it up through npm? If yes, go this way. Work through packages will give you the opportunity to clearly versioned, easy to release and roll back releases. - Nick Volynkin ♦
  • one
    And, now I realized that for builds - from gitlab. This is a tool to build, code and test your code before it enters the master. This is one possible way to launch a deployment — but not the only one. However, the deployment script itself can also be implemented in a variety of ways. - Nick Volynkin ♦
  • one
    In general, when deployment requires a sequence of actions, push-type configuration management systems are well suited, for example, ansible , chef . If you are satisfied with the decision on ansible, I can write the answer. Here quite good article about deployment of node.js through ansible. blog.carbonfive.com/2014/06/02/node-js-in-production - Nick Volynkin ♦
  • one
    I will try to write, but today I will not have time for sure. - Nick Volynkin ♦
  • one
    Less than a year, here's an excellent guide to deploying it from gitlab: GitLab CI: Learning to Deploy - Nick Volynkin ♦

0