Beispiel #1
0
// 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));
Task::log("You chose " . $selectedDir->getPath() . "\n\n");
CliTask::promptQuit('Continue? [y/n]: ');
// ********************
// *** Checkout
//
SvnTask::checkoutClean($workingCopy);
SvnTask::createManifestFile($workingCopy, FALSE, TRUE);
// ********************
// Sync files and folders
//
$rsyncOptions = new RsyncOptions($workingCopy->dir, $selectedDir);
$rsyncOptions->chmod('Du=rwx,Dg=rwx,Do=rwx,Fu=rw,Fg=rw,Fo=r')->excludesAppend(array('/dev/', '/db/'));
FileSyncTask::sync($rsyncOptions);
Beispiel #2
0
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);
SvnTask::createManifestFile($workingCopy);
// ********************
// *** Validate build
//
$lastTagRevision = SvnTask::getLastTagRevision($maoTag);
Task::log("- Current revision: {$workingCopy->info->commitRevision}\n");
Task::log("- Last tag commit revision: {$lastTagRevision}\n");
if ($build === 'prod' && $workingCopy->info->commitRevision <= $lastTagRevision) {
    Task::log("The revision you want to tag is lower than or equal to the last tagged release revision\n");
    Task::log("Custom tags should be created manually\n\n");
    exit;
}
// ********************
// *** Prep notification email
//