Anyone have a better way of achieving what I want that doesn't require my hacked together `build.php --deploy` script?
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, "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.
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!