drone

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertEventConditions added in v1.0.0

func ConvertEventConditions(cond constraint.List, w *types.Workflow) ([]string, []error)

ConvertEventConditions converts a Drone *Conditions for the event field into a Woodpecker constraint.List, mapping event names along the way.

func New

func New() transform.Transformer

func TriggerToGlobalWhen added in v0.2.0

func TriggerToGlobalWhen(trigger *Trigger) (constraint.When, []error)

Types

type Clone added in v0.1.0

type Clone struct {
	Disable bool `yaml:"disable"`
	Depth   *int `yaml:"depth"`
}

type Conditions added in v0.1.0

type Conditions struct {
	Conditions core.Strings `yaml:"-"`
	Include    core.Strings `yaml:"include,omitempty"`
	Exclude    core.Strings `yaml:"exclude,omitempty"`
}

func (*Conditions) IsEmpty added in v0.1.0

func (c *Conditions) IsEmpty() bool

func (*Conditions) Transform added in v0.2.0

func (c *Conditions) Transform() constraint.List

func (*Conditions) UnmarshalYAML added in v0.1.0

func (c *Conditions) UnmarshalYAML(unmarshal func(interface{}) error) error

type DronePipeline

type DronePipeline struct{}

func (DronePipeline) Convert

func (d DronePipeline) Convert(pipeline *Pipeline) (*types.Workflow, []error)

func (DronePipeline) ConvertConditions added in v0.1.0

func (d DronePipeline) ConvertConditions(when *When, w *types.Workflow) (constraint.When, []error)

func (DronePipeline) ConvertImage

func (d DronePipeline) ConvertImage(image string) string

func (DronePipeline) ConvertVolumes added in v0.1.0

func (d DronePipeline) ConvertVolumes(volumes []*Volume, refs []VolumeRef) ([]*types.Volume, []error)

func (DronePipeline) PostProcess added in v0.1.1

func (d DronePipeline) PostProcess(yaml []byte) ([]byte, error)

func (DronePipeline) Transform

func (d DronePipeline) Transform(sources []*transform.Source) ([]transform.Destination, error)

type Pipeline

type Pipeline struct {
	Kind      string            `yaml:"kind"`
	Type      string            `yaml:"type"`
	Name      string            `yaml:"name"`
	Platform  *Platform         `yaml:"platform"`
	Workspace *Workspace        `yaml:"workspace"`
	Node      map[string]string `yaml:"node"`
	Clone     *Clone            `yaml:"clone"`
	Services  []*Service        `yaml:"services"`
	Steps     []*Step           `yaml:"steps"`
	Trigger   *Trigger          `yaml:"trigger"`
	DependsOn []string          `yaml:"depends_on"`
	Volumes   []*Volume         `yaml:"volumes"`
}

type Platform added in v0.1.0

type Platform struct {
	OS      string `yaml:"os"`
	Arch    string `yaml:"arch"`
	Version string `yaml:"version"`
}

type Service added in v0.1.0

type Service struct {
	Name        string             `yaml:"name"`
	Image       string             `yaml:"image"`
	Pull        string             `yaml:"pull"`
	Environment core.MapOrEnvArray `yaml:"environment"`
	Commands    []string           `yaml:"commands"`
	Entrypoint  []string           `yaml:"entrypoint"`
	Privileged  bool               `yaml:"privileged"`
	Volumes     []VolumeRef        `yaml:"volumes"`
	WorkingDir  string             `yaml:"working_dir"`
}

type Setting added in v0.3.0

type Setting struct {
	Name  string
	Value interface{}
}

type Settings added in v0.3.0

type Settings []Setting

func (Settings) MarshalYAML added in v0.3.0

func (s Settings) MarshalYAML() (interface{}, error)

func (Settings) Transform added in v0.3.0

func (s Settings) Transform() map[string]any

func (*Settings) UnmarshalYAML added in v0.3.0

func (s *Settings) UnmarshalYAML(unmarshal func(interface{}) error) error

type Step

type Step struct {
	Name        string             `yaml:"name"`
	Image       string             `yaml:"image"`
	Pull        string             `yaml:"pull"`
	Environment core.MapOrEnvArray `yaml:"environment"`
	Settings    Settings           `yaml:"settings"`
	Commands    []string           `yaml:"commands"`
	DependsOn   []string           `yaml:"depends_on"`
	Detach      bool               `yaml:"detach"`
	Privileged  bool               `yaml:"privileged"`
	Failure     string             `yaml:"failure"`
	Volumes     []VolumeRef        `yaml:"volumes"`
	When        *When              `yaml:"when"`
	User        string             `yaml:"user"`
}

type Trigger added in v0.1.0

type Trigger struct {
	Branch       *Conditions  `yaml:"branch"`
	Event        *Conditions  `yaml:"event"`
	Ref          *Conditions  `yaml:"ref"`
	Repositories *Conditions  `yaml:"repo"`
	Status       core.Strings `yaml:"status"`
	Target       *Conditions  `yaml:"target"`
	Cron         *Conditions  `yaml:"cron"`
	Action       *Conditions  `yaml:"action"`
	Paths        *Conditions  `yaml:"paths"`
}

https://docs.drone.io/pipeline/docker/syntax/trigger

type UnsupportedEventError added in v0.1.0

type UnsupportedEventError struct {
	Event string
}

func (UnsupportedEventError) Error added in v0.1.0

func (e UnsupportedEventError) Error() string

func (UnsupportedEventError) Is added in v1.0.0

func (e UnsupportedEventError) Is(target error) bool

type Volume added in v0.1.0

type Volume struct {
	Name string      `yaml:"name"`
	Host *VolumeHost `yaml:"host"`
	Temp *VolumeTemp `yaml:"temp"`
}

type VolumeHost added in v0.1.0

type VolumeHost struct {
	Path string `yaml:"path"`
}

type VolumeRef added in v0.1.0

type VolumeRef struct {
	Name string `yaml:"name"`
	Path string `yaml:"path"`
}

type VolumeTemp added in v0.1.0

type VolumeTemp struct {
	Medium string `yaml:"medium"`
}

type When added in v0.1.0

type When struct {
	Branch       *Conditions  `yaml:"branch"`
	Event        *Conditions  `yaml:"event"`
	Ref          *Conditions  `yaml:"ref"`
	Repositories *Conditions  `yaml:"repo"`
	Instance     *Conditions  `yaml:"instance"`
	Status       core.Strings `yaml:"status"`
	Target       *Conditions  `yaml:"target"`
	Cron         *Conditions  `yaml:"cron"`
}

https://docs.drone.io/pipeline/docker/syntax/conditions

type Workspace added in v0.1.0

type Workspace struct {
	Base string `yaml:"base"`
	Path string `yaml:"path"`
}

Jump to

Keyboard shortcuts

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