There is a repository in Gitlab. The repository is cloned on another server.

It is necessary to make sure that after pushing to the project repository in Gitlab, the remote repository executes the pull command.

Update :

On the nginx server, in the settings I specified locations, in which, using lua, a bash script is called with updating the repository and set up a webhook in Gitlab for this url.

  • one
    You need to use hooks. Inside the hook you can ssh or otherwise pull on another server and it will do everything. - KoVadim
  • @KoVadim, by the way, what are hooks in this case? - Timur Musharapov
  • @KoVadim do not tell me how to use webhooks correctly? I understand you need to write a script on the server where the remote repository is located and add a link to it in Gitlab. - bigspawn
  • First, on the "other server" you need to write a script that will do the desired action (for example, pull). Then go to the guitar tab in the webbooks and add the "twitching script" to the push hook. But most importantly, a pool may not be a quick affair. And gitlab expects that everything will work quickly. Therefore, start the task in the background and immediately respond to the gitlab that everything is ok. - KoVadim

1 answer 1

Is it critical for you to have this happen right away? In most cases, it is enough to adjust the schedule to pull three times a day - in the morning, at lunch and in the evening.