Answer the question
In order to leave comments, you need to log in
How to do git-pull on server, right after git push on local?
I can’t fully understand how to make it so that when pushing on a local computer, there was immediately a git pull from the side of the working server?
I looked at the CI systems, but as I understand it, they collect all this in containers, and they have no interaction with the real host ... Why do we need CI then? Or I don't understand something. Help plz.
For example, I don't want to go to the server and do a pull every time I commit..
Answer the question
In order to leave comments, you need to log in
ci needs to be integrated with deployment systems.
well, if you don’t need ci buns, then you should use only the deployment system.
Set https://github.com/adnanh/webhook
set up to do pull
On gitlab set up the appropriate webhook
As already mentioned here, one option is a webhook.
BUT git pull in production is not a good idea because you will have a copy of the turnip in production. This is not very good and secure.
Best practice:
- you do a git push to a turnip (or merge PR)
- if necessary, the CI system does a build
- CI copies the necessary files (artifacts) to the prod. With rsync, scp, ftp, whatever. Usually, at the same time, you need to add some keys, passwords, etc. to the prod, which are not in the turnip, but CI has them (from settings, user input, from Vault, ...)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question