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

When setting up config files, you can reference environmental variables:

PHP Code:
$db['default'] = array(
    
'dsn'    => '',
    
'dbprefix' => '',
    
'hostname' => getenv('DB_HOST'),
    
'database' => getenv('DB_DATABASE'),
    
'username' => getenv('DB_USERNAME'),
    
'password' => getenv('DB_PASSWORD'),
    
'dbdriver' => getenv('DB_CONNECTION'),
... 

That way the code does not change, but your dev, staging, testing and production and production temp could all use what ever you set for said instance is required.

For database, as mentioned before, doing it manually could get very painful, especially when you have multiple people with multiple dev instances running.

I ended up writing my own little patch system, but I assume most of the systems work in same way - they somehow bookmark most recent applied batch, which will be unique per instance, and it then can figure out what batches and in what order it needs to run to be up to date.

The main problem with DB is that it could take some time to change sometimes, if you have huge amount of data, but you could try to have backwards compatible approach, if possible. Basic example - you add new field to DB, by giving it default value the old app can still add these records in DB, with built in default value feature, and new app knows to use app data if available.
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
RE: Using CI in "blue-green" deployment - by Pertti - 09-10-2018, 02:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB