Does it still have the `.git` folder? If so, I'll stick to writing regular build scripts, as nice as this seems. I also want to push a snapshot of a build artifact (sort of, it's PHP after all) - not sending a few folders, sending commands to the remote server to execute, etc.
Anyone have a better way of achieving what I want that doesn't require my hacked together `build.php --deploy` script?
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, "[email protected]: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.