GIT central repository + external server communication

2

Good morning, I have a question, here in the company where we work, we think about creating a shared local server that will be the central repository and everyone will clone and give push . So far, well instead of a github would be on the local server even though the changes / new versions would stay, the question is: After giving push to that local server, how do you upload those changes to the site / system that is hosted online?

Can I as a developer after giving push to the repository here place a command run and then communicate with the external site / system and upload the changes? I do not know if I was clear.

    
asked by anonymous 03.11.2016 / 14:19

1 answer

5

The executar um comando pra subir as alterações process is called Deploy. You can do this by writing your own git hooks or by integrating an external tool.

There are several tools that integrate with GIT repositories to do this. One I like is the DeployBot . Some more advanced GIT services, such as Beanstalk , also automatically do this for simpler setups without requiring any other integration.

Normally you will do an integration and determine type rules

  

"when a new push is made to branch X automatically   copy the changed files to server Y then run the Z and W commands on the destination server. "

Tools such as DeployBot automatically integrate with known services such as Gitlab, Github, or Bitbucket and offer a control panel where you control which deploys have been made and can undo or redo, among other actions.

The part of specifying commands to run on the server is especially useful when you are dealing with concatenated and minified files, very common in javascript. So you just need to keep the source files versioned, greatly reducing merge conflicts.

    
03.11.2016 / 14:23