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 New(ctx context.Context, opts clients.CommonOpts) (pipeline.Client, error)
- func NewDaggerStep(c pipeline.Configurer, path, state, version string, p pipeline.Pipeline) (*yaml.Container, error)
- type Client
- type DroneLanguage
Constants ¶
This section is empty.
Variables ¶
var ( ErrorNoImage = errors.NewPipelineError("no image provided", "An image is required for all steps in Drone. You can specify one with the '.WithImage(\"name\")' function.") ErrorNoName = errors.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 ¶
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'
func NewDaggerStep ¶
Types ¶
type Client ¶
type Client struct { Opts clients.CommonOpts Log *logrus.Logger }
Client is the Drone implementation of the pipeline Client interface. It will create a `.drone.yml` file that will run your pipeline the same way that it would run locally. It uses the dagger client to run an entire pipeline as a single step. While not ideal for visualization purposes, this does behavior is what enables consistency.
func (*Client) Done ¶
Done traverses through the tree and writes a .drone.yml file to the provided writer
type DroneLanguage ¶
type DroneLanguage int
const ( // The languages that are available when generating a Drone config. LanguageYAML DroneLanguage = iota LanguageStarlark )