Welcome Guest, Not a member yet? Register   Sign In
Environment Deployment Tips - CI & Doctrine
#1

[eluser]Unknown[/eluser]
Does anyone have any tips for deployment of a CodeIgniter project to a hosted environment?

Currently I'm zipping up the project source folder (minus .svn folders), manually setting up a database with a db user and appropriate permissions, configuring the two files config.php and database.php to be specific to the environment and then pointing the browser to the base url of the project which will setup some tables and test data for us to use.

While this is all well and good for performing a one-time deploy to an environment, however, I've found that all I seem to get is grief grief grief when deploying to a different environment. Each environment I deploy to appears to have some problem or another. For example, I have Doctrine hooked in to facilitate the database interaction and in one environment it has recently started complaining that it cannot find the pdo for mysql. Another environment has issues with auto-loading classes.

Do you guys have any tips you can give myself and other users when deploying to multiple environments? Any things we can do to minimise problems moving from on environment to another. Ironically, I know that running CI under XAMPP basically doesn't work without a fix to XAMPP itself, but all of the local project copies I and my fellow teammates have running on Wamp Server run absolutely fine...

How do you deploy to an production/live environment - using a script?! Do you use phing or an ant equivalent?

Where do you take the source copies from? Straight from svn using an svn update on your repository? Are there any major problems you've encountered with CI & Doctrine that you've had to find a hack around or were incredibly frustrating problems.

Any pearls of wisdom you can give would be greatly appreciated!

p.s. you can check out an example I have of the project deployed to separate environments with their respective errors.
http://nitrous.nozhosting.com/nitrous/lightweight and
http://www.jmblogger.com/nitrous/lightweight
#2

[eluser]renownedmedia[/eluser]
In my config/database.php I check the $_SERVER['HTTP_HOST'] and change the active db group based on the server. My localhost XAMPP has root:"", and my live will have prefix_table:"4i9g944un-0".

Try to set up conditional statement which check the server status and change how your CI functions appropriately.

Keep a master CI template that you can use as a base when starting new projects with commonly used libraries, views, and things like above.
#3

[eluser]n0xie[/eluser]
You might find this interesting: http://heypanda.com/posts/6-Deploying-Co...Capistrano

We're testing with Capistrano atm. Before that we just used rsync and bash scripts.
#4

[eluser]Unknown[/eluser]
Fantastic tips guys, keep them coming. Capistrano sounds interesting and pretty much exactly what I'd be after. I don't use Dreamhost so it may take a bit of configuring to get it going but getting it to work directly with svn would be precisely what most people need.
#5

[eluser]n0xie[/eluser]
There is a clone of capistrano for PHP, called fredistrano. I haven't looked at it, but you might want to give it a try: http://code.google.com/p/fredistrano/
#6

[eluser]Unknown[/eluser]
[quote author="n0xie" date="1251233616"]You might find this interesting: http://heypanda.com/posts/6-Deploying-Co...Capistrano

We're testing with Capistrano atm. Before that we just used rsync and bash scripts.[/quote]

If you need help with this, let me know. I wrote that quite a while ago, and haven't kept it current.




Theme © iAndrew 2016 - Forum software by © MyBB