Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does using git for deploy have any distinct advantages over sending .tar.gz?

This question seeks to isolate factual differences between two approaches to deployment, not subjective. Review the list at the end for concrete concepts.

I'm currently looking at options for deploying my app from wherever it's built. I've been reading a lot about 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 desired files and then ship that out to the server.

The more I think about this, the more I feel like simply scripting the creation and send of the archive is simpler and is "more static" than depending on git for deploy.

The main factors so far that have me favouring a simple archive are:

  • The destination doesn't have to have git or any other tools installed
  • I don't have to set up any special keys for dependency checkout on the destination
  • When using git, the deployed repository will always be larger than the actual deployed code
  • I'll have one less git repository to muddle with keeping consistent
  • In my specific case, I also have dependencies that are built or retrieved outside of the git repository (composer, bower, grunt)
  • I can select a subset of files to deploy, not the entire branch/tag
  • The prepared package is a fully working distribution of my site, almost like a binary

Further reading:

  • http://gitolite.com/deploy.html#why-git-is-not-a-deployment-tool
like image 588
Alexander Trauzzi Avatar asked Dec 10 '25 18:12

Alexander Trauzzi


1 Answers

There are two different ways I go about doing this. One is to actually clone the git repo onto the server and do pulls from the command line on the server. The second is to use a deployment tool like http://dploy.io/ which (s)ftp's the files from the repo to the server.

In both instances I .gitignore from the repository anything that is installed via (composer, bower, grunt) and do that from the command line on the server manually when needed. I am satisfied with the workflow of both methods and use the one more appropriate for the server being deployed to and the team that will need to do future deployments.

like image 191
AndrewVT Avatar answered Dec 13 '25 06:12

AndrewVT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!