$sourceDb = $devDb; $destinationDb = $prodDbPublic; $syncDestinationDir1 = $preprodDir; $syncDestinationDir2 = $prodDir; $sourceDbSchema = 'cogecouat'; $destinationDbSchema = 'cogecouattest'; if ($build === 'prod') { // Prod setup $syncDestinationDir2 = $prodDir; $destinationDbSchema = 'cogeco'; $cogecoCaReleaseEmail->to = array('*****@*****.**'); } $rsyncOptions1 = new RsyncOptions($workingCopy->dir, $syncDestinationDir1); $rsyncOptions1->excludesAppend(array('/dev/')); $rsyncOptions2 = new RsyncOptions(new Dir($syncDestinationDir1->getPath()), new Dir($syncDestinationDir2->getPath())); $rsyncOptions2->useSsh(FALSE)->excludesAppend(array('/dev/')); // ******************************* // Start the build script // ******************************* // Config::enableLogging(TRUE, TRUE); // ******************** // *** Initial output // Task::log("\n---------------------------------------\n"); Task::log("-------- Deploy Prod\n\n"); // Chicken quit //if ($build === 'prod') { // CliTask::promptQuit('Deploying to production! Continue? [y/n]: '); //} // Prompt for user password, if it's not hardcoded
// Use test for testing the script or prod for production use // Common configs for test/prod $workingCopy = $maoWcTrunk; $revisionToCheckOut = 0; $syncDestinationDir1 = $maoDevTempDir; $syncDestinationDir2 = $maoDev1Dir; if ($build === 'prod') { // Prod setup $syncDestinationDir1 = $maoProdTempDir; $syncDestinationDir2 = $maoProdDir; $maoReleaseEmail->to = $maoReleaseEmailRecipients; } $rsyncOptions1 = new RsyncOptions($maoWcTrunk->dir, $syncDestinationDir1); $rsyncOptions1->excludesAppend(array('/user_guide/', '/license.txt', 'application/logs/', '/dev/')); $rsyncOptions2 = new RsyncOptions($syncDestinationDir1, $syncDestinationDir2); $rsyncOptions2->useSsh(FALSE)->excludesAppend(array('/user_guide/', '/license.txt', 'application/logs/', '/dev/', '/application/config/production/routes.php')); // ******************************* // Start the build script // ******************************* Config::enableLogging(TRUE, TRUE); // ******************** // *** Initial output // Task::log("\n---------------------------------------\n"); Task::log("-------- Deploy Prod\n\n"); // Chicken quit if ($build === 'prod') { CliTask::promptQuit('Deploying to production! Continue? [y/n]: '); } // Prompt for user password, if it's not hardcoded CliTask::promptAccountPassword($cogecoAccount);
$syncDestinationDir2 = $maoDev1Dir; $configDirName = 'development'; $server = 'dev1'; if ($build === 'prod') { // Prod setup $syncDestinationDir1 = $maoProdTempDir; $syncDestinationDir2 = $maoProdDir; $configDirName = 'production'; $server = $build; } $maintenanceFileSource = new File($workingCopy->getDir()->getPath() . 'application/config/production/', 'maintenance_routes.php'); $maintenanceFileDestination = new File($syncDestinationDir2->getPath() . 'application/config/' . $configDirName, 'routes.php', $syncDestinationDir2->getHost()); $rsyncOptions1 = new RsyncOptions($maoWcTrunk->dir, $syncDestinationDir1); $rsyncOptions1->excludesAppend(array('/user_guide/', '/license.txt', 'application/logs/', '/dev/')); $rsyncOptions2 = new RsyncOptions($syncDestinationDir1, $syncDestinationDir2); $rsyncOptions2->useSsh(FALSE)->excludesAppend(array('/user_guide/', '/license.txt', 'application/logs/', '/dev/', "/application/config/{$configDirName}/routes.php")); // ******************************* // Start the build script // ******************************* Config::enableLogging(TRUE, TRUE); // ******************** // *** Initial output // Task::log("\n---------------------------------------\n"); Task::log("-------- Activate maintenance mode and deploy\n\n"); // Chicken quit if ($build === 'prod') { CliTask::promptQuit('Deploying to production! Continue? [y/n]: '); } // Prompt for user password, if it's not hardcoded CliTask::promptAccountPassword($cogecoAccount);