Beispiel #1
0
// *** 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
//
$logEntries = SvnTask::getLogEntries($workingCopy, $lastTagRevision + 1, $workingCopy->info->commitRevision);
// Convert log entries into text and html
$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");
//