<p>So, in your experience, whats the best way? Is there a secure way that's also scriptable/triggerable in a build automation tool?</p>

<p>Edit: I should mention this is windows/.net and I'll be deploying to iis6</p>

[{'answer_id': 18231, 'author': 'mk.', 'author_id': 1797, 'author_profile': 'https://Stackoverflow.com/users/1797', 'pm_score': 4, 'selected': True, 'text': '<p>For some projects I use <a href="http://www.capify.org/" rel="nofollow noreferrer">Capistrano</a> to push out to live. It is built on top of ruby and makes deploy script writing super easy and uses ssh. </p>\n\n<p>On other projects I have a tiny deploy app that uses bash to do an svn export to a temporary directory and then rsync it over to the live server. You can make rsync use ssh.</p>\n\n<p>I greatly prefer the Capistrano method, even if your project isn\'t in ruby/rails.</p>\n'}, {'answer_id': 18234, 'author': 'TheSmurf', 'author_id': 1975282, 'author_profile': 'https://Stackoverflow.com/users/1975282', 'pm_score': 0, 'selected': False, 'text': "<p>You could always write a small client/server app that encrypts at the source, pushes the files, and then decrypts at the destination. That's a little bit of work, but probably a trivial amount. And it's scriptable as long as your automation tool supports executing something in the file system (which I think all do).</p>\n\n<p>The only downside is that you may not be able to get meaningful error messages on failure in your integration environment without a bit more work on your part (though depending on your setup, this could be as simple as sending error messages to stdout).</p>\n"}, {'answer_id': 18240, 'author': 'mauriciopastrana', 'author_id': 547, 'author_profile': 'https://Stackoverflow.com/users/547', 'pm_score': 0, 'selected': False, 'text': '<p>hm, around here we use a staging "server" for testing purposes on the live environment (actually, its an apache virtual host on the production server) and <a href="http://www.araxis.com/merge/index.html" rel="nofollow noreferrer">araxis merge</a> (a really smart line-by-line file comparison tool) to sync development and staging.</p>\n\n<p>once its tested, just; replace the files on the production webroot :)</p>\n\n<p>/mp</p>\n'}, {'answer_id': 18241, 'author': 'T Percival', 'author_id': 954, 'author_profile': 'https://Stackoverflow.com/users/954', 'pm_score': 2, 'selected': False, 'text': '<p>This seems like the sort of thing that could be done easily with SFTP. Take a look at <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" rel="nofollow noreferrer">PuTTY</a> (psftp and pscp) or <a href="http://winscp.net/eng/docs/introduction" rel="nofollow noreferrer">WinSCP</a> for Windows, or <a href="http://rsync.samba.org/" rel="nofollow noreferrer">rsync</a> and <a href="http://www.openssh.org/" rel="nofollow noreferrer">OpenSSH</a> for Unixes.</p>\n'}, {'answer_id': 18243, 'author': 'Neall', 'author_id': 619, 'author_profile': 'https://Stackoverflow.com/users/619', 'pm_score': 1, 'selected': False, 'text': '<p>Make a copy of your live site directory, use <a href="http://samba.anu.edu.au/rsync/" rel="nofollow noreferrer">rsync</a> to update that copy with your latest version, then rename the live and updated directories so that the updated version is now live.</p>\n\n<p>In bash:</p>\n\n<pre><code>#!/bin/bash\n\nset -e\ncp -R /var/livesite /var/newversion\nrsync user@devserver:/var/readytogolive /var/newversion\nmv /var/livesite /var/oldlivesite\nmv /var/newversion /var/livesite\n</code></pre>\n\n<p>Viola!</p>\n\n<p>Edit: @Ted Percival - That\'s a good idea. I didn\'t even know about "set -e". Updated script. Edit: updated again at Ted\'s suggestion (although I think it would still work if somehow the cp command failed, and if cp fails you probably have more serious problems.)</p>\n'}, {'answer_id': 18267, 'author': 'T Percival', 'author_id': 954, 'author_profile': 'https://Stackoverflow.com/users/954', 'pm_score': 1, 'selected': False, 'text': "<p>@Neall, I'd add a <code>set -e</code> on the second line, because you don't want the live site being replaced if the <code>rsync</code> fails for any reason. <code>set -e</code> causes the script to exit if any of its commands fail.</p>\n\n<p>Edit: The <code>set -e</code> should be the first thing in the script, right after <code>#!/bin/bash</code>.</p>\n"}, {'answer_id': 21850, 'author': 'Grant Goodale', 'author_id': 2334, 'author_profile': 'https://Stackoverflow.com/users/2334', 'pm_score': 1, 'selected': False, 'text': '<p>I\'ll second the recommendation for <a href="http://www.capify.org" rel="nofollow noreferrer">Capistrano</a>, though if you\'re looking for a GUI-based solution you could try the <a href="http://blog.innerewut.de/webistrano/" rel="nofollow noreferrer">Webistrano</a> front end.  Clean, ssh-based, sane deployment and rollback semantics and easy scripting and extensibility via ruby.</p>\n'}, {'answer_id': 21853, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 0, 'selected': False, 'text': "<p>On a freelance job I did, we set up three seperate enviroments.</p>\n\n<ul>\n<li>A Dev server, that ran continues builds using CruiseControl. Any check-in would trigger a build. QA Testing was done here.</li>\n<li>A Test Server, that user acceptance testing was done on.</li>\n<li>Production.</li>\n</ul>\n\n<p>The workflow was as followed:</p>\n\n<ol>\n<li>Developer checks in changes to SourceControl.</li>\n<li>CruiseControl builds and deploys the build to Dev.</li>\n<li>Dev is QA'ed</li>\n<li>After passing QA, a robocopy script is ran that deploys the Dev build to Test.</li>\n<li>Test is UAT'ed</li>\n<li>After Test passes, a robocopy script is ran that deploys Test to PRD.</li>\n</ol>\n"}]
['https://Stackoverflow.com/questions/18224', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1946/']