Differential D8599 Diff 20429 src/applications/harbormaster/step/UploadArtifactBuildStepImplementation.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/step/UploadArtifactBuildStepImplementation.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_FILE); | HarbormasterBuildArtifact::TYPE_FILE); | ||||
$artifact->setArtifactData(array( | $artifact->setArtifactData(array( | ||||
'filePHID' => $file->getPHID())); | 'filePHID' => $file->getPHID())); | ||||
$artifact->save(); | $artifact->save(); | ||||
} | } | ||||
public function getArtifactMappings() { | |||||
$settings = $this->getSettings(); | |||||
return array( | |||||
$settings['name'] => HarbormasterBuildArtifact::TYPE_FILE); | |||||
} | |||||
public function validateSettings() { | public function validateSettings() { | ||||
$settings = $this->getSettings(); | $settings = $this->getSettings(); | ||||
if ($settings['path'] === null || !is_string($settings['path'])) { | if ($settings['path'] === null || !is_string($settings['path'])) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($settings['name'] === null || !is_string($settings['name'])) { | if ($settings['name'] === null || !is_string($settings['name'])) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($settings['hostartifact'] === null || | if ($settings['hostartifact'] === null || | ||||
!is_string($settings['hostartifact'])) { | !is_string($settings['hostartifact'])) { | ||||
return false; | return false; | ||||
} | } | ||||
// TODO: Check if the host artifact is provided by previous build steps. | // TODO: Check if the host artifact is provided by previous build steps. | ||||
return true; | return true; | ||||
} | } | ||||
public function getArtifactInputs() { | |||||
return array( | |||||
array( | |||||
'name' => pht('Upload From Host'), | |||||
'key' => $this->getSetting('hostartifact'), | |||||
'type' => HarbormasterBuildArtifact::TYPE_HOST, | |||||
), | |||||
); | |||||
} | |||||
public function getArtifactOutputs() { | |||||
return array( | |||||
array( | |||||
'name' => pht('Uploaded File'), | |||||
'key' => $this->getSetting('name'), | |||||
'type' => HarbormasterBuildArtifact::TYPE_FILE, | |||||
), | |||||
); | |||||
} | |||||
public function getSettingDefinitions() { | public function getSettingDefinitions() { | ||||
return array( | return array( | ||||
'path' => array( | 'path' => array( | ||||
'name' => 'Path', | 'name' => 'Path', | ||||
'description' => | 'description' => | ||||
'The path of the file that should be retrieved. Note that on '. | 'The path of the file that should be retrieved. Note that on '. | ||||
'Windows machines running FreeSSHD, this path will be relative '. | 'Windows machines running FreeSSHD, this path will be relative '. | ||||
'to the SFTP root path (configured under the SFTP tab). You can '. | 'to the SFTP root path (configured under the SFTP tab). You can '. | ||||
Show All 17 Lines |