Exemplo n.º 1
0
// *******************************
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);
Exemplo n.º 2
0
$changesText = ViewTask::getLogEntriesText($logEntries);
$changesHtml = ViewTask::getLogEntriesHtml($logEntries);
// Load the email templates with the changes
$emailText = ViewTask::load('views/template-release-text.php', array('changes' => $changesText), TRUE);
$emailHtml = ViewTask::load('views/template-release-html.php', array('changes' => $changesHtml), TRUE);
// Create the emails as files
$emailFileBaseName = "release-prod-r{$workingCopy->info->commitRevision}";
EmailTask::createEmailFiles($emailFileBaseName, $emailHtml, $emailText);
// ********************
// *** Deploy intermediate
//
// Sync files from the working copy to the temporary prod directory
FileSyncTask::sync($rsyncOptions1);
//
Task::log("- Syncing intermediate directory {$syncDestinationDir1->path} with {$syncDestinationDir2->path}\n\n");
//
$rsyncCommand = FileSyncTask::getRsyncCommand($rsyncOptions2);
SshTask::exec($syncDestinationDir2->getHost(), $rsyncCommand);
Task::log("\n");
// ********************
// *** Tag release
//
if ($build === 'prod') {
    SvnTask::tagRelease($maoTag, $workingCopy->dir->path, "Release to production - Revision: {$workingCopy->info->commitRevision}");
}
// ********************
// *** Notify
//
$maoReleaseEmail->bodyHtml = $emailHtml;
$maoReleaseEmail->bodyText = $emailText;
EmailTask::sendEmail($emailConnector, $maoReleaseEmail);