A co-worker of mine always complains that people don’t read the RFC that covers a topic related to making their own stuff work with our stuff. He’s old sk00l like that. Although my co-worker is a tad out-of-touch with the realities of programming these days (as in the amount of people who actually read the RFC when they can simply use someone else’s library / module / function / application is very small), I thought I would at least adhere to some semblance of standards and do a blog posting about my plans for making CakePHP application deployment easier.
While I really prefer to use tools like this for deployment, I understand that not everyone wants to mess with standalone programs and configuration files. I’ve been asked before about Cake-specific deployment techniques, so I figure the easiest way is to see about adding a task to the Cake console. Let’s call this ‘cake deploy’.
As I explained on the mailing list I am looking for opinions on what sort of things should be part of the ‘cake deploy’ task. Right now, my thoughts are as follows:
- cake deploy config
- cake deploy – seems pretty self-explanatory to me.
– setup and edit configuration parameters. Initially I thought of setting things like transport method (ssh, ftp), logins and passwords, remote location, source directory, and destination directory. The configuration file would be stored locally in APP/config
In the RFC thread on the CakePHP mailing list, someone mentioned they’d like to see rsync, but I’m trying to avoid having to external programs required to make the deployment work. Or, at least, use as few as possible. Anyhow, if you have any thoughts on this feel free to add them to the comments.
Tags: CakePHP, Deployment, RFC

Hi.
I’ve been using the stuff that felix put out there a while back, and also tried using capistrano for my cake appz. But the thing that I’ve been mostly pleased with is Pake (From the symfony project ), can be downloaded as a file or a pear package.
But a task to cakephp to use this would be amazing, the rsync option are much more preffered when it comes to speed but isn’t always possible to use ( no shell access etc ). And in my eyes, something that is for cake should be as easy to use for the novice user but also powerful for the more advanced user.
Dont know what my point is really, maybe that ftp fits better with my view on cakephp, and i really look forward to see where this goes, great initiative.
Hi! You may look at this post http://blog.devayd.com/?p=8 it’s in spanish but it’s not hard to understand how works this simple deploy module (http://blog.devayd.com/wp-content/uploads/2008/04/deployment.png)
This is an implementation detail, but Phing would be an excellent choice to embed to handle the deploy command. The only problem I could see is the mixing of LGPL and MIT. The custom tasks you created would have to be LGPL, but the interface to it – the part that handles the actual execution of Phing – could be MIT without problem.
‘course, I’m no lawyer and this isn’t intended as legal advice, yada yada yada…
But as someone with commit privileges on Phing, I’d really like to see other communities using it instead of trying to roll their own.
@Travis
It’s not so much “roll your own” as “integrate into existing tools”. If ‘cake deploy’ were to fire off Phing as part of a deployment, that’s fine by me too. It doesn’t matter what happens behind the scenes of a deployment, just so long as it works properly.
I would say that a deployment tool should do the following things
Should
Should be able to push to multiple destinations with rule sets for each (you know the drill staging/ dev/ beta/ production)
Should be able to reset the caches on destination (can’t even count the number of friggen questions that turn out to have this at the core on the cake list)
Should have some ability to run tests before deployment and conditionally do something
Would
Would be nice to support database actions on push (not migrations per say but to be able to sync staging with production db would be nice)
Would be nice to support repositories of various flavors (plug in interface for adding extending)
Would be nice to have some kind of rollback support like cap does
Would be nice to support simple filesystem operations on the target (mv, cp, chmod) of course this is likely to need some kind of shell interface since some people might be deploying in non-unix flavor environments
Would be nice to have an extendable interface for other upload/sync operations (sftp, rsync, scp, you know the drill)
Would be nice to have deployment controlled from local machine and dependent on minimum requirements server side (I have a hell of a lot more control over what is on my box then what goes on the server)
Would be nice if it could deploy non-cakephp assets (capistrano got much better when it’s dependance on rails was loosened) there are many parts of a site that may be outside of the CakePHP structure….
Is this what you were looking for.
Did you take a look at fredistrano?
http://code.google.com/p/fredistrano/
The idea of a devoted task for that seems a very very good one to me.
I’ve left you some comments on the group.
I really like your approach to the topic – its good to see that opinions are collected in forms of RFC or others
Chris,
We tend to use shared hosts, so server side operations can be a bit tricky – we have no console access, for example.
In the meantime, are you aware of any tools that can ‘read’ a Subversion repository and a remote fs and determine which files need to be updated and where they must be put? I’m trying to avoid FTPing the whole site everytime I make a change.
Leo
Chris, I was thinking about building a similar task for a while, I would love to help out with this. Let me know if you need a hand for anything.
[...] public links >> phing Stop stop stop… Saved by vongjohnny on Fri 14-11-2008 CakePHP Application Deployment: RFC Saved by mahoro568 on Mon 10-11-2008 Re: Performance – Requiring the Autoloader Saved by [...]
Found this via Google when searching for deployment tools specifically designed for Cake apps. Any progress in this area lately?
[...] moley, has it been almost a year since I blogged about a potential CakePHP deployment task. Since a few people have hit me up in Twitter and in the comments for that blog post, I thought I [...]