drone

package
v0.0.0-...-f249b6c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package drone implements output to .drone.yml.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasDroneOutput

func HasDroneOutput() dag.NodeCondition

HasDroneOutput checks if the node implements Compiler and has any output from drone.

Types

type Compiler

type Compiler interface {
	CompileDrone(*Output) error
}

Compiler is implemented by project blocks which support Drone config generation.

type CustomCompiler

type CustomCompiler interface {
	DroneEnabled() bool
}

CustomCompiler is implemented by custom steps.

type Output

type Output struct {
	output.FileAdapter

	PipelineType       string
	NotifySlackChannel string
	BuildContainer     string
	// contains filtered or unexported fields
}

Output implements Drone project config generation.

func NewOutput

func NewOutput() *Output

NewOutput creates new .drone.yml output.

func (*Output) Compile

func (o *Output) Compile(compiler Compiler) error

Compile implements output.TypedWriter interface.

func (*Output) Filenames

func (o *Output) Filenames() []string

Filenames implements output.FileWriter interface.

func (*Output) GenerateFile

func (o *Output) GenerateFile(filename string, w io.Writer) error

GenerateFile implements output.FileWriter interface.

func (*Output) Pipeline

func (o *Output) Pipeline(name string, targets []string, crons []string) *Pipeline

Pipeline creates a new pipeline which can be triggered via promotion/cron.

func (*Output) Service

func (o *Output) Service(spec *yaml.Container)

Service appends a new service.

func (*Output) Step

func (o *Output) Step(step *Step)

Step appends a step to the default pipeline.

func (*Output) VolumeHostPath

func (o *Output) VolumeHostPath(name, hostPath, mountPath string) *Output

VolumeHostPath adds a host path mount.

func (*Output) VolumeHostPathStandalone

func (o *Output) VolumeHostPathStandalone(name, hostPath string) *Output

VolumeHostPathStandalone adds a host path mount, but doesn't make it default mount.

func (*Output) VolumeTemporary

func (o *Output) VolumeTemporary(name, mountPath string) *Output

VolumeTemporary adds a temporary (tmpfs) volume mount.

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

Pipeline wraps custom pipelines to handle step appending.

func (*Pipeline) Service

func (p *Pipeline) Service(service *yaml.Container)

Service appends a new service.

func (*Pipeline) Step

func (p *Pipeline) Step(step *Step)

Step appends a step to the pipeline.

type Step

type Step struct {
	// contains filtered or unexported fields
}

Step is a pipeline Step.

func CustomStep

func CustomStep(target string, commands ...string) *Step

CustomStep creates a step which calls some shell script.

func MakeStep

func MakeStep(target string, args ...string) *Step

MakeStep creates a step which calls make target.

func (*Step) DependsOn

func (step *Step) DependsOn(depends ...string) *Step

DependsOn appends to a list of step dependencies.

func (*Step) DockerLogin

func (step *Step) DockerLogin() *Step

DockerLogin sets up login to registry.

func (*Step) EmptyDirVolume

func (step *Step) EmptyDirVolume(name, mountPath string) *Step

EmptyDirVolume mounts an empty dir volume to the step.

func (*Step) Environment

func (step *Step) Environment(name, value string) *Step

Environment appends an environment variable to the step.

func (*Step) EnvironmentFromSecret

func (step *Step) EnvironmentFromSecret(name, secretName string) *Step

EnvironmentFromSecret appends an environment variable from secret to the step.

func (*Step) ExceptPullRequest

func (step *Step) ExceptPullRequest() *Step

ExceptPullRequest adds condition to skip step on PRs.

func (*Step) Image

func (step *Step) Image(image string) *Step

Image sets step image.

func (*Step) LocalRegistry

func (step *Step) LocalRegistry() *Step

LocalRegistry sets up pushing to local registry.

func (*Step) Name

func (step *Step) Name(name string) *Step

Name provides a name to a step.

func (*Step) OnlyOnBranch

func (step *Step) OnlyOnBranch(branchName string) *Step

OnlyOnBranch adds condition to run step only on the specified branch.

func (*Step) OnlyOnPullRequest

func (step *Step) OnlyOnPullRequest() *Step

OnlyOnPullRequest adds condition to run step only on PRs.

func (*Step) OnlyOnTag

func (step *Step) OnlyOnTag() *Step

OnlyOnTag adds condition to run step only on tags.

func (*Step) Privileged

func (step *Step) Privileged() *Step

Privileged marks step as privileged.

func (*Step) PublishArtifacts

func (step *Step) PublishArtifacts(note string, artifacts ...string) *Step

PublishArtifacts publishes artifacts with the default Github settings.

func (*Step) ResourceRequests

func (step *Step) ResourceRequests(cpuCores, memoryGib int) *Step

ResourceRequests sets step resource requests.

type StepService

type StepService interface {
	Service(spec *yaml.Container)
	Step(step *Step)
}

StepService provides base Drone compilation to a pipeline.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL