Documentation ¶
Overview ¶
Package drone contians the drone client implementation for generating a Drone pipeline config.
Index ¶
- Variables
- func Events(events []pipeline.Event) (yaml.Conditions, error)
- func HandleSecrets(c pipeline.Configurer, step pipeline.Step) (map[string]*yaml.Variable, map[string]string)
- func NewStep(c pipeline.Configurer, path, state, version string, step pipeline.Step) (*yaml.Container, error)
- type Client
- func (c *Client) Done(ctx context.Context, w pipeline.Walker) error
- func (c *Client) StepWalkFunc(log logrus.FieldLogger, s *stepList, state string) func(ctx context.Context, steps ...pipeline.Step) error
- func (c *Client) Validate(step pipeline.Step) error
- func (c *Client) Value(arg pipeline.Argument) (string, error)
- type DroneLanguage
Constants ¶
This section is empty.
Variables ¶
var ( ErrorNoImage = plumbing.NewPipelineError("no image provided", "An image is required for all steps in Drone. You can specify one with the '.WithImage(\"name\")' function.") ErrorNoName = plumbing.NewPipelineError("no name provided", "A name is required for all steps in Drone. You can specify one with the '.WithName(\"name\")' function.") )
var ( PipelinePath = "/var/scribe/pipeline" StatePath = "/var/scribe-state" ScribeVolume = &yaml.Volume{ Name: "scribe", EmptyDir: &yaml.VolumeEmptyDir{}, } HostDockerVolume = &yaml.Volume{ Name: stringutil.Slugify(pipeline.ArgumentDockerSocketFS.Key), HostPath: &yaml.VolumeHostPath{ Path: "/var/run/docker.sock", }, } ScribeStateVolume = &yaml.Volume{ Name: "scribe-state", EmptyDir: &yaml.VolumeEmptyDir{}, } ScribeVolumeMount = &yaml.VolumeMount{ Name: "scribe", MountPath: "/var/scribe", } ScribeStateVolumeMount = &yaml.VolumeMount{ Name: "scribe-state", MountPath: StatePath, } )
Functions ¶
func Events ¶ added in v0.9.4
func Events(events []pipeline.Event) (yaml.Conditions, error)
Events converts the list of pipeline.Events to a list of drone 'Conditions'. Drone conditions are what prevents pipelines from running whenever certain certain conditions are met, or what runs pipelines only when certain conditions are met.
func HandleSecrets ¶
func HandleSecrets(c pipeline.Configurer, step pipeline.Step) (map[string]*yaml.Variable, map[string]string)
HandleSecrets handles the different 'Secret' arguments that are defined in the pipeline step. Secrets are given a generated value and placed in the 'environment', not a user-defined one. That value is then used when the pipeline attempts to retrieve the value in the argument. String arguments are already provided in the command line arguments when `cmdutil.StepCommand'
Types ¶
type Client ¶
type Client struct { Opts pipeline.CommonOpts Log *logrus.Logger // Language defines the language of the pipeline that will be generated. // For example, if Language is LanguageYAML, then the generated pipeline // will be the yaml that will tell drone to run the pipeline as it is written. // // Other languages will be generated using functions that you can use within // your own pipelines in those other languages. They are intended to facilitate // transitions between other systems and Scribe. Language DroneLanguage }
func (*Client) Done ¶
Done traverses through the tree and writes a .drone.yml file to the provided writer
func (*Client) StepWalkFunc ¶
type DroneLanguage ¶
type DroneLanguage int
const ( // The languages that are available when generating a Drone config. LanguageYAML DroneLanguage = iota LanguageStarlark )