GIT central repository + external server communication

Asked

Viewed 57 times

2

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

It is possible for me as a developer after giving the push pro repository here local execute a command and then communicate with the external site/system and upload the changes? I’m not sure I was clear.

1 answer

5

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

There are several tools that integrate with GIT repositories to do this. One that I like is Deploybot. Some more advanced GIT services, like the Beanstalk, also do this automatically for simpler setups without needing another integration.

Normally you will do an integration and determine rules type

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

Tools like 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 only need to keep the source files versioned, greatly reducing merge conflicts.

  • Oops, ball show, I’ll research more on the Deploybot and start doing some tests here, Fight!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.