Show HN: better software deployment with Git
github.com
github.com
I appreciate the work that has gone into this code, but if you want to deploy using source control then you should really be looking into continuous integration and deployment.
If I'm working on a Python project, I could possibly create a Fabric file to help automate the deployment. Anyone working on the same project would have to install Fabric, and figure out any quirks it has.
The same then applies to every other language. They tend to recreate deployment tools in their own language to solve the exact same problem. Capistrano for Ruby, etc. Everyone has to learn the deployment process for each different project.
Using git as a deployment tool means that the only person who has to worry about the deployment process is the one who creates the server side commit hook/push scripts. All the complexity is taken away, they just have to say "push to git@example.org" and all the magic behind it is taken care of.
It's universal between all projects. If I'm running a PaaS, all I have to tell my users is to put files in a specific place, add a config file, push to our servers. Without this, users of every language might need specific deployment tools, or be forced to use a generic one which might not suit their needs.
Git has hooks for kicking off processes, its extensible, deployment scripts don't alter the core of git. What's the problem with evolving something?
Don't fight the distro, people. They've hit all of your problems harder, sooner, and with more edge-cases than you can care to imagine.
Anyone have a better way of achieving what I want that doesn't require my hacked together `build.php --deploy` script?
Right now, your source is potentially downloadable via the web, if a developer accidentally places a password in the code and then later reverts the change, its still in the history for someone to find. Plus they get the ability to rip off your work because you've made it public. Or perhaps just scan it for flaws to exploit.
I know what your going to say, that you can mitigate these problems with a simple configuration change. However is everybody that you give the code to going to do that on every server they deploy?
I only know about it because I've been burned by it in the past!
I agree that this is an issue, I'll have to see if I can find a clever way to get around this.
Thanks so much for this tool btw, I really like the look of it!
It's a bit much at first, but once you realize that it's basically just a build file with some handy functionality baked in, it's very useful. Here's an example of a deploy script for deploying a git repo to a single machine:
set :application, "Project Name"
set :repository, "git@github.com:project/project.git"
set :use_sudo, false
set :user, "deploy_user"
set :shared_children, ["list", "of", "directories/to", "symlink/rather/than/copy"]
set :copy_exclude, [".git/*"]
set :scm, :git
set :branch, "master"
set :deploy_via, :remote_cache
set :keep_releases, 5
set :deploy_to, "/path/to/deploy/to"
server "1.2.3.4", :app, :web, :db
Then you just run `cap deploy` and you're deploying. `cap rollback` instantly rolls back to the previous revision of your code. That deploy script keeps 5 releases and manages a symlink that points to the current release. The git repo is kept checked out, and then is updated and copied to a release directory, so you have multiple separate snapshots of your application on hand.It's also extremely extensible; we use it to do asset pre-builds, send deployment notices to Hipchat and NewRelic, flush caches, restart background workers, and the like.