Пример #1
0
use Cogeco\Build\Config;
use Cogeco\Build\Task;
use Cogeco\Build\Entity\RsyncOptions;
use Cogeco\Build\Entity\WorkingCopy;
use Cogeco\Build\Task\CliTask;
use Cogeco\Build\Task\FileSyncTask;
use Cogeco\Build\Task\SvnTask;
// Include the build script core
include_once __DIR__ . '/../../bootstrap.php';
// *******************************
// Script configuration
// *******************************
// *******************************
// Start the build script
// *******************************
Config::enableLogging();
// ********************
// *** Initial output
//
Task::log("\n---------------------------------------\n");
Task::log("-------- Sync repository\n\n");
// Prompt for user password, if it's not hardcoded
CliTask::promptAccountPassword($cogecoAccount);
// ********************
// Prompt user input
//
// Prompt user to input a local folder to sync
$workingCopy = CliTask::promptRepo();
Task::log("You chose " . $workingCopy->getRepoUrl() . "\n\n");
// Prompt user to chose a remote folder to sync to
$selectedDir = CliTask::promptDir(array($devDir, $dev2Dir, $uatDir, $uat2Dir, $uat3Dir, $preprodDir));
Пример #2
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);
// ********************
// *** SVN checkout
//
SvnTask::checkoutClean($workingCopy, $revisionToCheckOut);