Page MenuHomePhabricator
Paste P1228

NotifyBuildSystemCustomAction.php
ActivePublic

Authored by epriestley on Aug 11 2014, 9:24 PM.
Tags
None
Referenced Files
F189027: NotifyBuildSystemCustomAction.php
Aug 11 2014, 9:24 PM
Subscribers
None
<?php
final class NotifyBuildSystemCustomAction extends HeraldCustomAction {
public function appliesToAdapter(HeraldAdapter $adapter) {
return ($adapter instanceof HeraldDifferentialRevisionAdapter);
}
public function appliesToRuleType($rule_type) {
return ($rule_type == HeraldRuleTypeConfig::RULE_TYPE_GLOBAL);
}
public function getActionKey() {
return 'zeeg.build';
}
public function getActionName() {
return pht('Run Zeeg Build');
}
public function getActionType() {
return HeraldAdapater::VALUE_NONE;
}
public function applyEffect(
HeraldAdapter $adapter,
$object,
HeraldEffect $effect) {
$revision = $object;
// NOTE: This specific API might change slightly at some point.
$diff = $object->loadActiveDiff();
// Implement a call here to your external build system.
$revision_id = $revision->getID();
$diff_id = $diff->getID();
phlog("Build D{$revision_id} / diff {$diff_id}.");
return new HeraldApplyTranscript(
$effect,
true,
pht('Ran plan.'));
}
}

Event Timeline

epriestley changed the title of this paste from untitled to NotifyBuildSystemCustomAction.php.
epriestley updated the paste's language from autodetect to autodetect.