Differential D8599 Diff 20429 src/applications/harbormaster/step/LeaseHostBuildStepImplementation.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/step/LeaseHostBuildStepImplementation.php
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | $artifact = $build->createArtifact( | ||||
$build_target, | $build_target, | ||||
$settings['name'], | $settings['name'], | ||||
HarbormasterBuildArtifact::TYPE_HOST); | HarbormasterBuildArtifact::TYPE_HOST); | ||||
$artifact->setArtifactData(array( | $artifact->setArtifactData(array( | ||||
'drydock-lease' => $lease->getID())); | 'drydock-lease' => $lease->getID())); | ||||
$artifact->save(); | $artifact->save(); | ||||
} | } | ||||
public function getArtifactMappings() { | |||||
$settings = $this->getSettings(); | |||||
return array( | |||||
$settings['name'] => HarbormasterBuildArtifact::TYPE_HOST); | |||||
} | |||||
public function validateSettings() { | public function validateSettings() { | ||||
$settings = $this->getSettings(); | $settings = $this->getSettings(); | ||||
if ($settings['name'] === null || !is_string($settings['name'])) { | if ($settings['name'] === null || !is_string($settings['name'])) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($settings['platform'] === null || !is_string($settings['platform'])) { | if ($settings['platform'] === null || !is_string($settings['platform'])) { | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
public function getArtifactOutputs() { | |||||
return array( | |||||
array( | |||||
'name' => pht('Leased Host'), | |||||
'key' => $this->getSetting('name'), | |||||
'type' => HarbormasterBuildArtifact::TYPE_HOST, | |||||
), | |||||
); | |||||
} | |||||
public function getSettingDefinitions() { | public function getSettingDefinitions() { | ||||
return array( | return array( | ||||
'name' => array( | 'name' => array( | ||||
'name' => 'Artifact Name', | 'name' => 'Artifact Name', | ||||
'description' => | 'description' => | ||||
'The name of the artifact to reference in future build steps.', | 'The name of the artifact to reference in future build steps.', | ||||
'type' => BuildStepImplementation::SETTING_TYPE_STRING), | 'type' => BuildStepImplementation::SETTING_TYPE_STRING), | ||||
'platform' => array( | 'platform' => array( | ||||
'name' => 'Platform', | 'name' => 'Platform', | ||||
'description' => 'The platform of the host.', | 'description' => 'The platform of the host.', | ||||
'type' => BuildStepImplementation::SETTING_TYPE_STRING)); | 'type' => BuildStepImplementation::SETTING_TYPE_STRING)); | ||||
} | } | ||||
} | } |