Changeset View
Changeset View
Standalone View
Standalone View
config/artifacts.go
Show All 17 Lines | type ArtifactsConfig struct { | ||||
From string `yaml:"from" validate:"required,variantref"` // source variant from which to copy | From string `yaml:"from" validate:"required,variantref"` // source variant from which to copy | ||||
Source string `yaml:"source" validate:"required"` // source variant path from which to copy | Source string `yaml:"source" validate:"required"` // source variant path from which to copy | ||||
Destination string `yaml:"destination" validate:"required"` // destination path within current variant | Destination string `yaml:"destination" validate:"required"` // destination path within current variant | ||||
} | } | ||||
// InstructionsForPhase injects instructions into the given build phase that | // InstructionsForPhase injects instructions into the given build phase that | ||||
// copy configured artifacts. | // copy configured artifacts. | ||||
// | // | ||||
// PhasePostInstall | // PhaseInstall | ||||
// | // | ||||
// Injects build.CopyFrom instructions for the configured source and | // Injects build.CopyFrom instructions for the configured source and | ||||
// destination paths. | // destination paths. | ||||
// | // | ||||
func (ac ArtifactsConfig) InstructionsForPhase(phase build.Phase) []build.Instruction { | func (ac ArtifactsConfig) InstructionsForPhase(phase build.Phase) []build.Instruction { | ||||
switch phase { | switch phase { | ||||
case build.PhasePostInstall: | case build.PhaseInstall: | ||||
return []build.Instruction{ | return []build.Instruction{ | ||||
build.CopyFrom{ac.From, build.Copy{[]string{ac.Source}, ac.Destination}}, | build.CopyFrom{ac.From, build.Copy{[]string{ac.Source}, ac.Destination}}, | ||||
} | } | ||||
} | } | ||||
return []build.Instruction{} | return []build.Instruction{} | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 3.0 (CC-BY-SA) unless otherwise noted; code licensed under GNU General Public License (GPL) or other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL