0

I am looking to setup my PHP app in cloud such that for every new customer, a new copy of app (with source code & mysql database) is deployed.

How this is best achieved in Amazon cloud? Is it something that can be done using the Amazon's git update? I need this to be automated to maximum extent such that if there's a new version, that should be propagated to all copies of clients. MySQL update is not an issue as whenever the app source code is updated, it runs the db updated on its own.

How can I automate the source code set and updates in this scenario?

Thanks

Deep
  • 55
  • 1
  • 8

1 Answers1

0

I did something exactly the same but using my own dedicated servers rather than a public cloud. I ended up using a "release" branch in my SVN server as the master code repository.

A cron script that checked the pending installs table every 5 minutes. If it found stuff in there it created a new folder for the new user, pulled the latest SVN, imported a master .sql file for the DB and created a db user. Wrote out a config file for the app into the created folder, wrote new bind entries and restarted bind. And wrote the foldername,DBname into a text file.

The there's a second script which runs every night and pulls the latest SVN into the folder name as stored in the text file and pulls and runs an updatedb.sql from the evn to run against the dbname in the text file too. Its not fool proof though and has taken alot of tinkering to get it stable. I dare say there's configuration management systems out there that'll do exactly what you/I wanted out of the box but tbh I enjoyed the challenge of writing my own.

Dave
  • 3,184
  • 2
  • 21
  • 40
  • That's a new and interesting direction..could you point me to the configuration management systems that you mentioned? Also..is it possible to setup these tasks using amazon elastic beans or windows azure such that every new instance created is mapped to one git respository. Whenever that respoitory updates, code is pulled by these systems automatically. – Deep Nov 12 '13 at 10:23
  • should be you'd have to look at their API but I decided against using the cloud based stuff as the cost of it was prohibitive for my application since I have my own dedicated servers it was easier for me to just map folders and edit bind/apache configs accordingly and restart the services. http://www.ansibleworks.com/ http://stackoverflow.com/questions/2180460/setting-up-a-deployment-build-ci-cycle-for-php-projects http://www.buildmeister.com/articles/automating_the_php_deployment_process_with_phing,_dbdeploy_and_ftp https://www.engineyard.com/products/cloud may help you – Dave Nov 12 '13 at 10:26