3 ms·
I use git to deploy about 30 sites and have found it to be a really useful workflow. It's particularly useful over SSH when using key-based authentication. For
by mikegirouard 13y ago
I use git to deploy about 30 sites and have found it to be a really useful workflow. It's particularly useful over SSH when using key-based authentication.
For my post-receive hook, I always add a tag to mark a deployment:
git tag deployment-`date +'%Y%m%d%H%M%S'`
You can see all past deployments with a git log:
git log prod/master --oneline --decorate
On all my developer machines, I have them add a `git-deploy` script to their $PATH, which looks a little something like:
#!/bin/bash
git push $1 +HEAD:master
git fetch $1
You can just run `git deploy prod` (assuming your deployment repository is named 'prod').
The extra `git fetch` will pull down the auto-generated tags so you can see them locally w/a simple `git tag`
Edit: Forgot to mention, that since git ships w/a bash shell for Windows, most of this should work for Windows-based dev setups as well.
- avar 13y agoYou might be interested in checking out git-deploy. It's a tool we wrote to manage tag creation and completely pluggable rollouts/rollbacks with sync hooks you write: https://github.com/git-deploy/git-deploy https://github.com/git-deploy/git-deploy It's basically a more advanced version of what you're doing.