Welcome Guest, Not a member yet? Register   Sign In
Using CI in "blue-green" deployment
#1

Hey guys, happy Friday!

I've been reading a lot about the "blue-green" deployment plan lately, and I was wondering how that works with CI.  To save you a Google search or two, this plan for deploying web apps basically has two production servers, but only one is actively used by end-users; the other one is a testing environment for the next version.  When a new version is ready, the router switches the two (so that all requests are sent to the new version, and the old is there as an emergency backup).  This makes a lot of sense at a high level, but it kind of raises a lot of questions in practice.  Specifically:

1. How does this work when database structure changes?

Wouldn't the DB have to be changed on both the "blue" and the "green" servers?  That wouldn't be as easy to undo if something goes wrong.  I have a feeling this is where CI's database "migrations" API comes in (?).  I haven't used it, but once I discovered it I read the docs on it.  I think it might help here (or would it?)

2. How does this work with CI's config files?

For example, settings like base_url and database connection variables will probably be different between the two servers.  Maybe I'm not understanding the whole blue-green thing correctly, but if one is a testing environment then logically it should have test/dummy data.  Either way, I think this means some manual file-swapping or other change would be involved.  Or do you just do something like:

$config['whatever'] = ENVIRONMENT == 'production' ? 'set this way' : 'set that way';   // ?

Anyway, thanks for your help and have an amazing weekend! Smile
Reply


Messages In This Thread
Using CI in "blue-green" deployment - by mfox - 09-07-2018, 02:13 PM
RE: Using CI in "blue-green" deployment - by mfox - 09-10-2018, 07:47 AM
RE: Using CI in "blue-green" deployment - by mfox - 09-10-2018, 02:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB