A common problem the engineering team is experiencing at Pollenizer is finding the resources to dedicate to system administration duties. With the vision of reducing those duties, Pollenizer has been exploring PaaS providers. I have reviewed services offered by Orchestra, PHP Fog and Pagoda Box. The stand out is clearly the latter.
PaaS providers typically offer deployment via Git hooks, most likely post-receive. This means you commit to the provider’s repository, and the code is immediately deployed. Having previously depended on managing deployments with Capistrano in traditional environments, I expect a similar interface from PaaS. Pagoda Box excels in scriptability of deployments compared to the other providers.
A YAML file named “Boxfile” in the root of the repository will be parsed during the deployment of a Pagoda Box application. The file is created and managed by the application author and prepares the Pagoda Box infrastructure for the newly pushed code.
I have developed a CakePHP Pagoda Boxfile which can be used as a base for new CakePHP applications. It uses all current Pagoda Boxfile Deploy Hooks for a pristine environment. Note that the Boxfile makes a number of assumptions:
- Pagoda specific database configuration file: app/Config/database.php.pagoda
- The Migrations plugin from CakeDC is used
web1: name: pagoda-webserver-name document_root: /app/webroot shared_writable_dirs: - app/tmp - app/tmp/cache - app/tmp/cache/models - app/tmp/cache/persistent - app/tmp/cache/views - app/tmp/logs - app/tmp/sessions - app/tmp/tests php_extensions: - mcrypt - mbstring - pdo_mysql - apc after_build: - "mv app/Config/database.php.pagoda app/Config/database.php" before_deploy: # https://github.com/CakeDC/migrations - "app/Console/cake Migrations.migration all" after_deploy: - "rm -rf app/tmp/cache/models/*" - "rm -rf app/tmp/cache/persistent/*" - "rm -rf app/tmp/cache/views/*" db1: name: pagoda-db-name type: mysql
The need for automating deployment tasks is critical for reducing the number of human errors, especially since Pagobox only offers a database connection via a non-standard tunnel. The Migrations plugin removes the need for performing schema changes by hand.
PaaS allows engineers to focus on development whilst removing the need to dedicate resources to system administrative duties, whilst a good provider will provide interfaces into the deployment routine.
Hi Simon,
I also choose cakephp as my choice to build my MVP.
What about your continuous integration on PaaS?
Personally I get a single server from rackspace and put jenkins on it.
Whenever I push code to my github private repo, jenkins will clone a fresh copy of the cakephp code on the same server.
Run all the PHPUnit tests. if all tests pass, jenkins will replace the current symlink to this new clone of the code base. if fail, jenkins will keep the symlink as it is.
Excited to hear your view on this.
Hi Kimsia,
I’ve only ever run tests locally. What I have being meaning to experiment with is OpenShift Jenkins ‘cartridge’. OpenShift is another PaaS provided by RedHat. Though I have yet to use it in production.
Sorry I cannot answer your question as my CI experience is limited.
Thank you for answering me, Simon. I met Phil in Singapore about a couple of months ago.
Love to be updated on Pollenizer blog. But apparently no rss feed or newsletter.
How do I get updated by your reply or latest post?
Kimsia, try this RSS feed (our mistake for not having a link to it): http://pollenizer.com/feed/
Also I’ve just relocated to Singapore, and will shortly start a CakePHP User Group. Please join if your interested.
http://www.meetup.com/Singapore-CakePHP-User-Group/
Have successfully subscribed to the rss feed.
Still not getting notified when you answer my comments.
Am signing up for cakephp Singapore meetup group