Hi - Ok, an update (and a question)...
I have my cloud pulling from bitbucket automatically - that's all great.
I'm now working on a solution to work locally, before pushing my changes to bitbucket (and ultimately, moments later, the cloud).
The way we work (which is slightly different to saschame's solution) is to have a '/site/' folder in the root, which contains all our static js/css/chunks/snippets etc etc. This is essentially all that is stored in our bitbucket repo.
Locally I have installed a copy of MODX (2.2.6), let's say 'C:\xampp\htdocs\sites\modx\modx-2.2.6-pl\'. I intend to "share" this installation with all those projects I run locally (proving they're all on the same version). Any new versions of MODX will get a new, seperate install on my machine.
So, I also have a projects folder, which contains all my projects, in 'C:\xampp\htdocs\sites\modx\projects\project-name'.
'project-name' contains the two php files, index.php & config.core.php, as well as the PULLED repo. Inside config.core.php I have set the following:
define('MODX_CORE_PATH', 'C:/xampp/htdocs/sites/modx/modx-2.2.6-pl/core/');
define('MODX_PROCESSORS_PATH', 'C:/xampp/htdocs/sites/modx/modx-2.2.6-pl/core/model/modx/processors/');
define('MODX_PROCESSORS_PATH', 'C:/xampp/htdocs/sites/modx/modx-2.2.6-pl/connectors/');
define('MODX_MANAGER_PATH', 'C:/xampp/htdocs/sites/modx/modx-2.2.6-pl/manager');
define('MODX_MANAGER_URL', '/manager/');
define('MODX_BASE_PATH', 'C:/xampp/htdocs/sites/modx/modx-2.2.6-pl/');
define('MODX_BASE_URL', '/');
define('MODX_ASSETS_PATH', 'C:/xampp/htdocs/sites/modx/modx-2.2.6-pl/assets/');
define('MODX_ASSETS_URL', '/assets/');
define('MODX_CACHE_DISABLED', true);
define('MODX_CONFIG_KEY', 'config');
define('MODX_DB_OVERRIDE', true);
define('MODX_DB_SERVER', 'localhost');
define('MODX_DB_USER', 'root');
define('MODX_DB_PASSWORD', '');
define('MODX_DB_NAME', 'modx-2.2.6-pl');
define('MODX_DB_PREFIX', 'modx_');
define('MODX_DB_DSN', 'mysql:host=localhost;dbname=modx-2.2.6-pl;charset=latin1');
You'll notice some new definitions there! That's because I've modified my LOCAL modx-2.2.6-pl config.inc.php (naughty, but it'll never get upgraded). There is now a new section right after the DB properties:
/******************************/
/* ADD TO YOUR config.inc.php */
if (defined('MODX_DB_OVERRIDE') && MODX_DB_OVERRIDE) {
$database_server = MODX_DB_SERVER;
$database_user = MODX_DB_USER;
$database_password = MODX_DB_PASSWORD;
$dbase = MODX_DB_NAME;
$table_prefix = MODX_DB_PREFIX;
$database_dsn = MODX_DB_DSN;
}
/* ADD TO YOUR config.inc.php */
/******************************/
So now my local projects can all dynamically set the DB I intend to use. Therefore each project has it's own DB, but I only need to install MODX once (for each version of MODX).
So, I can go to 'http://localhost:81/projects/project-name/' and I will be using the DB for my site. But, 'http://localhost:81/modx-2.2.6-pl/manager/' will still used the "original" DB.
Is there a way I can get 'http://localhost:81/projects/project-name/manager/' to route correctly? (as '/manager/' doesn't exist, so fails). This way I can have my manager using a different database each time too. Is this a good idea? I know different DBs will have different modules installed, but they'll ALL have the source (whether it's used or not).
I would LIKE this DB to be the cloud DB. Therefore, I can use the manager in the cloud, but build locally. If I install a module in the cloud, I just need to ensure it's also installed in my local MODX.
I feel I'm rambling here, and possible getting myself in a mess. I'd be interested to hear people's thoughts.