This question has already been answered:

People, share your experience or tips on how best to deploy a project from a github and / or bitbucket hosting project?
What are ready solutions and / or independent solutions?

Reported as a duplicate by participants aleksandr barakin , cheops , Pavel Mayorov , Alexey Shimansky , pavel Jul. 31 at 16:26 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • I didn’t catch the essence of the problem, is it possible in more detail !? - Kirill Stoianov
  • @KirillStoianov I want to figure out the question - how to upload a project developed on github or bitbucket to a combat server - buyboy

1 answer 1

The independent decision is based on so-called hooks . If the central repository is hosted on your server, with push, git calls your script, which takes the latest version of the code and deploys it.

With GitHub and bitbucket this number will not work - you can not mark up your scripts on their servers. Instead, you use web hooks - when pushing, GitHub accesses the URL you specified where you place the deployment script.

In the simplest case, the deployment script is to download the latest version of the code from the repository and copy it to the hosting directory, or upload it to FTP. In more complex cases, you may need to run the utility (for example, minifiers js and css) and even complete pre-build the project using make , Ant or MSBuild .

Thus, in addition to GitHub repositories and hosting, you should have an build server configured. For small projects, it can be placed in the same place as hosting. In the case of updating the code in the central repository, GitHub “calls” through a web request a script hosted on a build server that collects the project, runs the tests and copies the assembly to the hosting.

Ready-made solutions are based on the same principle, but instead of manually writing scripts, you use what the developers have already prepared for you. You take, for example, CruiseControl (available in versions for Java, .NET, Ruby, etc.) install it on your build-server, and configure it.

Many problems there are solved right out of the box, in particular, CruiseControl can notify you via e-mail about failed builds and prepare reports.

I personally, working under .NET, use Microsoft's Build Server, included in Visual Studio Online . For small teams of up to 5 people, and small assemblies it is even free. You need to look for a solution that fits your platform.

  • Thanks for the detailed answer! And what good solutions can you give? - buyboy
  • I added an answer in the article. Personally, I use Visual Studio Online, but I write under .NET, so that's why. Before that I used CruiseControl, it was enough for my personal needs. What platform do you have? - Mark Shevchenko
  • working on php in netBeans - buyboy
  • one
    Well, PHP does not require compilation, so in the simplest case, you can really place the script directly on the hosting to download the latest version of code from GitHub and copy it to the hosting folder. Unfortunately, I cannot recommend specific tools, since I haven’t been working with PHP for a long time. Google prompts phptesting.org and sismo.sensiolabs.org - Mark Shevchenko