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?
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?
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 .
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.
Source: https://ru.stackoverflow.com/questions/550382/
All Articles