Live data from Hacker News

Ask HN: How do you deploy your PHP apps to production?

news.ycombinator.com

31–40 of 57 posts

Re: Ask HN: How do you deploy your PHP apps to production?

#31
For Drupal, I use Aegir (http://groups.drupal.org/aegir/overview), Git, and Make files (http://drupal.org/project/drush_make).

Aegir let's me spin up as many copies of my project as I want for both testing + production.

Git (+ github) stores all my custom development.

My Make files pull together all of my custom code + drupal contributed code + any 3rd party libraries I'm using.

Re: Ask HN: How do you deploy your PHP apps to production?

#32

I started to use http://www.deployhq.com/ . I was already using their http://codebasehq.com for GIT hosting. Works great, server does not even need to have GIT installed, it can use ftp or ssh.

Upvoted, I've been checking this out recently. As a codebase customer they sent me a free account to deployHQ and it seems pretty nice. It has an API (with a rubygem) so you can integrate it into your scripts to achieve whatever level of fancyness you need.

I'm also looking into the possibilities around having a 'deploy' or 'production' branch in git, and a post-commit hook that automatically deploys (with another script obviously) any commits to that branch. This is how heroku works and it's much cleaner than capistrano in my eyes.

Re: Ask HN: How do you deploy your PHP apps to production?

#33

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,…

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?

#35
post #21

Right now I'm using symfony php framework that deploys the code to whatever server I want(uses rsync and you must have access to ssh on that server). All the projects are kept in svn repo's. I can imagine writing a script that just runs every so often to sync the staging server to the production server, however I don't really care for this method because I want more control. I may change my mind in the future. For so…

You could use a .htaccess file to prevent the .svn directory from being accessible, I would think

Re: Ask HN: How do you deploy your PHP apps to production?

#37

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,…

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?

#39
post #34

Goodness, I hope all the people using SVN to deploy are making sure that they're taking care of the .svn directories and the resulting security issues.

I assume they're `svn export`ing rather than `svn checkout`ing.

Yet I see at least one reference to `svn update`

I'm scurred.

Post reply on HN