Does using git for deployment have any advantage over uploading .tar.gz?

This question aims to isolate the actual differences between the two deployment approaches rather than subjective ones. Check out the list at the end for specific concepts.

I am currently looking at options to deploy my application from anywhere it was created. I have read a lot and am familiar with how git is sometimes used for deployment. I've also seen how you can simply create a tar.gz of the files you want and then send it to the server.

The more I think about it, the more I feel like just scripting the creation and uploading of the archive is easier and "more static" than depending on git to deploy.

The main factors that have so far been in favor of a simple archive are:

  • The target should not have git or any other tools installed
  • I don't need to configure special keys to check dependencies at destination
  • When using git, the deployed repository will always be larger than the actual deployed code
  • I will have one less git repository for the confusion keeping consistent
  • In my particular case, I also have dependencies that are created or fetched outside of the git repository (composer, gazebo, grunt).
  • I can select a subset of files to deploy rather than the entire branch / tag
  • The pre-packaged package is a fully working distribution of my site, almost like a binary

Further reading:

+3


source to share


2 answers


There are two different ways to do this. One is to actually clone the git repo to the server and pull from the command line on the server. Second, use a deployment tool like http://dploy.io/ which (a) transfers files from the repo to the server.



In both cases, I .gitignore from the repository everything installed via (composer, gazebo, grunt) and does it from the command line on the server manually when needed. I am happy with the workflow for both methods and am using another one that is appropriate for the server being deployed and for the team that will be needed for future deployments.

+2


source


The main difference between the two approaches (besides having Git on the production server) is the number of files that have to go over the network: the fewer files you have to migrate, the less error-prone the whole process is.

This is why I prefer to use git archive

tar (an archive of the specified format containing a tree structure for a named tree) to create the required file.



This way I only need to transfer one file like a normal archive and I don't need Git on the other side.

+2


source







All Articles