4 ms·
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 artif
by girvo 13y ago
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?
- drcongo 13y agoI like Fabric: http://docs.fabfile.org http://docs.fabfile.org
- jamesroseman 13y agoMy largest system builds and deploys with Fabric. We deal with multiple load-balancers with unique content, and it works perfectly. I use it for a master control Python script that watches/adds/etc our servers and our data.
- girvo 13y agoBrilliant. Cheers, I've been looking for something like this for ages. Sick of my hacky bash and PHP scripts.
- arnoooooo 13y agoYes it does, by design: I want to be able to check the integrity and diff easily on a delivered version, with or without the tool.
- nextw33k 13y agoWhilst I agree with your objectives and would love a tool that does this. I have not done so myself because of security problems with having .git in the website folder. I'll continue to use git's hooks to copy the files as I push them to the server. 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?
- girvo 13y agoWhat nextw33k said! It's not an issue for me: I _know_ the gotchas when dealing with this stuff (that's why I asked!), but the people I hire in the future might not. I only know about it because I've been burned by it in the past!
- arnoooooo 13y agoI have to admit I missed this aspect. I've only delivered projects where the main folder was not web accessible until now. I agree that this is an issue, I'll have to see if I can find a clever way to get around this.
- girvo 13y agoI had a feeling that was the case :) I will use this for smaller personal things for sure, but I think I've got to handle my startup slightly differently; I've got a lot of security things I have to be wary of! Thanks so much for this tool btw, I really like the look of it!
- andrewflnr 13y agoI use ansible and rsync for my personal site. I don't know how well that would work for something more complicated than static files, but I'm guessing just fine.
- felipellrocha 13y agoWait, what's wrong with the .git folder? I'm not sure I'm clear why that's an issue...
- arnoooooo 13y agoYou don't want to accidentally make it public, which might happen if your webserver points to the root of the git working copy.
- cheald 13y agoCapistrano is great. https://github.com/capistrano/capistrano https://github.com/capistrano/capistrano 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.