News for hackers. Stuff that matters.
Re:Ask HN: How do you deploy your PHP apps to production? by wvenable on Thursday October 14, 2010 @12:37PM (#1791527)
Subversion -- the website is a working copy of the production branch and I just do an svn update when changes need to be deployed.

The whole thing is wrapped up in a script that makes it possible to one-click deploy changes.

The biggest thing is the application is directory independent and auto-senses the host for database selection. This means that no changes are required to the application to run it in development, staging, or production.

Edit: Apache is setup so that no .svn directories are served. Given that most web applications go through a front-controller now, I'm hoping this isn't as much of a concern anymore.

Re:Ask HN: How do you deploy your PHP apps to production? by alc277 on Thursday October 14, 2010 @01:06PM (#1791652)
Just a word of advice to anybody using this approach - make sure to setup Apache(et al) to not serve .svn folders and files or someone will be able to download your code. I've always used a release shell script that does an svn export and just replaces the entire directory.
Re:Ask HN: How do you deploy your PHP apps to production? by sneak on Thursday October 14, 2010 @08:32PM (#1793216)
Or, better yet, don't put sensitive data in public web directories! Have your working copy somewhere else, and update your "svn update" script to also run an rsync with an --exclude=.svn to your web root.
Re:Ask HN: How do you deploy your PHP apps to production? by jacquesm on Thursday October 14, 2010 @01:00PM (#1791630)
Same here, not as nicely automated though (still need to actually type 'svn update').

What I really like is the ability to instantly roll back to any version.

Don't forget to block .svn directories in your apache config!

Re:Ask HN: How do you deploy your PHP apps to production? by wvenable on Thursday October 14, 2010 @01:34PM (#1791756)
The other advantage is sometimes, in emergency situations, I've had to edit the production code directly on the server. It's nice to be able to see what's changed, commit if necessary, or rollback to the original production version.
Re:Ask HN: How do you deploy your PHP apps to production? by jumby on Thursday October 14, 2010 @04:02PM (#1792365)
umm, isn't that what svn export is for :)

why stop at .svn, how about .~, .bak, .tmp, .swp !

Re:Ask HN: How do you deploy your PHP apps to production? by wvenable on Thursday October 14, 2010 @05:28PM (#1792700)
The problem with export is that you're deploying every single file. With svn update, you're only deploying the changed files.
Re:Ask HN: How do you deploy your PHP apps to production? by iamjpg on Thursday October 14, 2010 @02:09PM (#1791913)
We use Subversion as well. However, we use Ant scripts to do the build work. It makes updating our servers pretty straight forward.
Re:Ask HN: How do you deploy your PHP apps to production? by wvenable on Thursday October 14, 2010 @02:28PM (#1791995)
My sites are PHP so building is limited but some things do need to be built. However, my sites effectively build themselves without the need for another tool. On the first access of a resource, if the target doesn't exist it's built by the code automatically and stored in a cache. During development, the cache is disabled so you can edit and run without any intermediate build step. Things built this way include parts of the ORM and output templates.
Re:Ask HN: How do you deploy your PHP apps to production? by gregjor on Thursday October 14, 2010 @02:18PM (#1791947)
Same here, multiple sites. Using the same code base for dev/stage/production is a huge win.
Re:Ask HN: How do you deploy your PHP apps to production? by Keyframe on Thursday October 14, 2010 @12:56PM (#1791609)
Same here, but Mercurial instead of Subversion.
Re:Ask HN: How do you deploy your PHP apps to production? by Mamady on Thursday October 14, 2010 @05:12PM (#1792620)
svn up

simple.

priceless.