Differential D8600 Diff 20391 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 validateSettings() { | |||||
$settings = $this->getSettings(); | |||||
if ($settings['name'] === null || !is_string($settings['name'])) { | |||||
return false; | |||||
} | |||||
if ($settings['platform'] === null || !is_string($settings['platform'])) { | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
public function getArtifactOutputs() { | public function getArtifactOutputs() { | ||||
return array( | return array( | ||||
array( | array( | ||||
'name' => pht('Leased Host'), | 'name' => pht('Leased Host'), | ||||
'key' => $this->getSetting('name'), | 'key' => $this->getSetting('name'), | ||||
'type' => HarbormasterBuildArtifact::TYPE_HOST, | 'type' => HarbormasterBuildArtifact::TYPE_HOST, | ||||
), | ), | ||||
); | ); | ||||
} | } | ||||
public function getSettingDefinitions() { | public function getFieldSpecifications() { | ||||
return array( | return array( | ||||
'name' => array( | 'name' => array( | ||||
'name' => 'Artifact Name', | 'name' => pht('Artifact Name'), | ||||
'description' => | 'type' => 'text', | ||||
'The name of the artifact to reference in future build steps.', | 'required' => true, | ||||
'type' => BuildStepImplementation::SETTING_TYPE_STRING), | ), | ||||
'platform' => array( | 'platform' => array( | ||||
'name' => 'Platform', | 'name' => pht('Platform'), | ||||
'description' => 'The platform of the host.', | 'type' => 'text', | ||||
'type' => BuildStepImplementation::SETTING_TYPE_STRING)); | 'required' => true, | ||||
), | |||||
); | |||||
} | } | ||||
} | } |