Documentation ¶
Index ¶
- Constants
- type Build
- type BytesSize
- type Clone
- type Concurrency
- type Condition
- type Conditions
- type Container
- type Cron
- type CronDeployment
- type CronSpec
- type ExternalData
- type Manifest
- type Parameter
- type Pipeline
- type Platform
- type Port
- type Push
- type RawResource
- type Registry
- type Resource
- type ResourceObject
- type Resources
- type Secret
- type SecretGet
- type Signature
- type Variable
- type Volume
- type VolumeDevice
- type VolumeEmptyDir
- type VolumeHostPath
- type VolumeMount
- type Workspace
Constants ¶
const ( KindCron = "cron" KindPipeline = "pipeline" KindRegistry = "registry" KindSecret = "secret" KindSignature = "signature" )
Resource enums.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct { Args map[string]string `json:"args,omitempty"` CacheFrom []string `json:"cache_from,omitempty" yaml:"cache_from"` Context string `json:"context,omitempty"` Dockerfile string `json:"dockerfile,omitempty"` Image string `json:"image,omitempty"` Labels map[string]string `json:"labels,omitempty"` }
Build configures a Docker build.
func (*Build) UnmarshalYAML ¶
UnmarshalYAML implements yaml unmarshalling.
type BytesSize ¶
type BytesSize int64
BytesSize stores a human-readable size in bytes, kibibytes, mebibytes, gibibytes, or tebibytes (eg. "44kiB", "17MiB").
func (BytesSize) String ¶
String returns a human-readable size in bytes, kibibytes, mebibytes, gibibytes, or tebibytes (eg. "44kiB", "17MiB").
func (*BytesSize) UnmarshalYAML ¶
UnmarshalYAML implements yaml unmarshalling.
type Clone ¶
type Clone struct { Disable bool `json:"disable,omitempty"` Depth int `json:"depth,omitempty"` SkipVerify bool `json:"skip_verify,omitempty" yaml:"skip_verify"` }
Clone configures the git clone.
type Concurrency ¶
type Concurrency struct {
Limit int `json:"limit,omitempty"`
}
Concurrency limits pipeline concurrency.
type Condition ¶
type Condition struct { Include []string `yaml:"include,omitempty" json:"include,omitempty"` Exclude []string `yaml:"exclude,omitempty" json:"exclude,omitempty"` }
Condition defines a runtime condition.
func (*Condition) Match ¶
Match returns true if the string matches the include patterns and does not match any of the exclude patterns.
func (*Condition) UnmarshalYAML ¶
UnmarshalYAML implements yml unmarshalling.
type Conditions ¶
type Conditions struct { Action Condition `json:"action,omitempty"` Cron Condition `json:"cron,omitempty"` Ref Condition `json:"ref,omitempty"` Repo Condition `json:"repo,omitempty"` Instance Condition `json:"instance,omitempty"` Target Condition `json:"target,omitempty"` Event Condition `json:"event,omitempty"` Branch Condition `json:"branch,omitempty"` Status Condition `json:"status,omitempty"` Paths Condition `json:"paths,omitempty"` Matrix map[string]string `json:"matrix,omitempty"` }
Conditions defines a group of conditions.
type Container ¶
type Container struct { Build *Build `json:"build,omitempty"` Command []string `json:"command,omitempty"` Commands []string `json:"commands,omitempty"` Detach bool `json:"detach,omitempty"` DependsOn []string `json:"depends_on,omitempty" yaml:"depends_on"` Devices []*VolumeDevice `json:"devices,omitempty"` DNS []string `json:"dns,omitempty"` DNSSearch []string `json:"dns_search,omitempty" yaml:"dns_search"` Entrypoint []string `json:"entrypoint,omitempty"` Environment map[string]*Variable `json:"environment,omitempty"` ExtraHosts []string `json:"extra_hosts,omitempty" yaml:"extra_hosts"` Failure string `json:"failure,omitempty"` Image string `json:"image,omitempty"` Network string `json:"network_mode,omitempty" yaml:"network_mode"` Name string `json:"name,omitempty"` Ports []*Port `json:"ports,omitempty"` Privileged bool `json:"privileged,omitempty"` Pull string `json:"pull,omitempty"` Push *Push `json:"push,omitempty"` Resources *Resources `json:"resources,omitempty"` Settings map[string]*Parameter `json:"settings,omitempty"` Shell string `json:"shell,omitempty"` User string `json:"user,omitempty"` Volumes []*VolumeMount `json:"volumes,omitempty"` When Conditions `json:"when,omitempty"` WorkingDir string `json:"working_dir,omitempty" yaml:"working_dir"` }
Container defines a Docker container configuration.
type Cron ¶
type Cron struct { Version string `json:"version,omitempty"` Kind string `json:"kind,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Spec CronSpec `json:"spec,omitempty"` }
Cron is a resource that defines a cron job, used to execute pipelines at scheduled intervals.
func (*Cron) GetVersion ¶
GetVersion returns the resource version.
type CronDeployment ¶
type CronDeployment struct {
Target string `json:"target,omitempty"`
}
CronDeployment defines a cron job deployment.
type CronSpec ¶
type CronSpec struct { Schedule string `json:"schedule,omitempty"` Branch string `json:"branch,omitempty"` Deploy CronDeployment `json:"deployment,omitempty" yaml:"deployment"` }
CronSpec defines the cron job.
type ExternalData ¶
type ExternalData struct { Path string `json:"path,omitempty"` Name string `json:"name,omitempty"` }
ExternalData defines the path and name of external data located in an external or remote storage system.
type Manifest ¶
type Manifest struct {
Resources []Resource
}
Manifest is a collection of Drone resources.
func ParseBytes ¶
ParseBytes parses the configuration from bytes b.
func ParseString ¶
ParseString parses the configuration from string s.
func (*Manifest) MarshalJSON ¶
MarshalJSON implement the json.Marshaler.
func (*Manifest) MarshalYAML ¶
MarshalYAML is not implemented and returns an error. This is because the Manifest is a representation of multiple yaml documents, and MarshalYAML would otherwise attempt to marshal as a single Yaml document. Use the Encode method instead.
func (*Manifest) UnmarshalJSON ¶
UnmarshalJSON implement the json.Unmarshaler.
type Parameter ¶
type Parameter struct { Value interface{} `json:"value,omitempty"` Secret string `json:"from_secret,omitempty" yaml:"from_secret"` }
Parameter represents an configuration parameter that can be defined as a literal or as a reference to a secret.
func (*Parameter) MarshalYAML ¶
MarshalYAML implements yaml marshalling.
func (*Parameter) UnmarshalYAML ¶
UnmarshalYAML implements yaml unmarshalling.
type Pipeline ¶
type Pipeline struct { Version string `json:"version,omitempty"` Kind string `json:"kind,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Clone Clone `json:"clone,omitempty"` Concurrency Concurrency `json:"concurrency,omitempty"` DependsOn []string `json:"depends_on,omitempty" yaml:"depends_on" ` Node map[string]string `json:"node,omitempty" yaml:"node"` Platform Platform `json:"platform,omitempty"` PullSecrets []string `json:"image_pull_secrets,omitempty" yaml:"image_pull_secrets"` Services []*Container `json:"services,omitempty"` Steps []*Container `json:"steps,omitempty"` Trigger Conditions `json:"trigger,omitempty"` Volumes []*Volume `json:"volumes,omitempty"` Workspace Workspace `json:"workspace,omitempty"` }
Pipeline is a resource that defines a continuous delivery pipeline.
func (*Pipeline) GetVersion ¶
GetVersion returns the resource version.
type Platform ¶
type Platform struct { OS string `json:"os,omitempty"` Arch string `json:"arch,omitempty"` Variant string `json:"variant,omitempty"` Version string `json:"version,omitempty"` }
Platform defines the target platform.
type Port ¶
type Port struct { Port int `json:"port,omitempty"` Host int `json:"host,omitempty"` Protocol string `json:"protocol,omitempty"` }
Port represents a network port in a single container.
func (*Port) UnmarshalYAML ¶
UnmarshalYAML implements yaml unmarshalling.
type Push ¶
type Push struct {
Image string `json:"image,omitempty"`
}
Push configures a Docker push.
func (*Push) UnmarshalYAML ¶
UnmarshalYAML implements yaml unmarshalling.
type RawResource ¶
RawResource is a raw encoded resource with the resource kind and type extracted.
func ParseRaw ¶
func ParseRaw(r io.Reader) ([]*RawResource, error)
ParseRaw parses the multi-document yaml from the io.Reader and returns a slice of raw resources.
func ParseRawBytes ¶
func ParseRawBytes(b []byte) ([]*RawResource, error)
ParseRawBytes parses the multi-document yaml from b and returns a slice of raw resources.
func ParseRawFile ¶
func ParseRawFile(p string) ([]*RawResource, error)
ParseRawFile parses the multi-document yaml from path p and returns a slice of raw resources.
func ParseRawString ¶
func ParseRawString(s string) ([]*RawResource, error)
ParseRawString parses the multi-document yaml from s and returns a slice of raw resources.
type Registry ¶
type Registry struct { Version string `json:"version,omitempty"` Kind string `json:"kind,omitempty"` Type string `json:"type,omitempty"` Data map[string]string `json:"data,omitempty"` }
Registry is a resource that provides encrypted registry credentials and pointers to external registry credentials (e.g. from vault).
func (*Registry) GetVersion ¶
GetVersion returns the resource version.
type Resource ¶
type Resource interface { // GetVersion returns the resource version. GetVersion() string // GetKind returns the resource kind. GetKind() string }
Resource represents a Drone resource.
type ResourceObject ¶
ResourceObject describes compute resource requirements.
type Resources ¶
type Resources struct { // Limits describes the maximum amount of compute // resources allowed. Limits *ResourceObject `json:"limits,omitempty"` // Requests describes the minimum amount of // compute resources required. Requests *ResourceObject `json:"requests,omitempty"` }
Resources describes the compute resource requirements.
type Secret ¶
type Secret struct { Version string `json:"version,omitempty"` Kind string `json:"kind,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Data string `json:"data,omitempty"` Get SecretGet `json:"get,omitempty"` }
Secret is a resource that provides encrypted data and pointers to external data (i.e. from vault).
func (*Secret) GetVersion ¶
GetVersion returns the resource version.
type SecretGet ¶
type SecretGet struct { Path string `json:"path,omitempty"` Name string `json:"name,omitempty"` Key string `json:"key,omitempty"` }
SecretGet defines a request to get a secret from an external sevice at the specified path, or with the specified name.
type Signature ¶
type Signature struct { Version string `json:"version,omitempty"` Kind string `json:"kind"` Hmac string `json:"hmac"` }
Signature is a resource that provides an hmac signature of combined resources. This signature can be used to validate authenticity and prevent tampering.
func (*Signature) GetVersion ¶
GetVersion returns the resource version.
type Variable ¶
type Variable struct { Value string `json:"value,omitempty"` Secret string `json:"from_secret,omitempty" yaml:"from_secret"` }
Variable represents an environment variable that can be defined as a string literal or as a reference to a secret.
func (*Variable) MarshalYAML ¶
MarshalYAML implements yaml marshalling.
func (*Variable) UnmarshalYAML ¶
UnmarshalYAML implements yaml unmarshalling.
type Volume ¶
type Volume struct { Name string `json:"name,omitempty"` EmptyDir *VolumeEmptyDir `json:"temp,omitempty" yaml:"temp"` HostPath *VolumeHostPath `json:"host,omitempty" yaml:"host"` }
Volume that can be mounted by containers.
type VolumeDevice ¶
type VolumeDevice struct { Name string `json:"name,omitempty"` DevicePath string `json:"path,omitempty" yaml:"path"` }
VolumeDevice describes a mapping of a raw block device within a container.
type VolumeEmptyDir ¶
type VolumeEmptyDir struct { Medium string `json:"medium,omitempty"` SizeLimit BytesSize `json:"size_limit,omitempty" yaml:"size_limit"` }
VolumeEmptyDir mounts a temporary directory from the host node's filesystem into the container. This can be used as a shared scratch space.
type VolumeHostPath ¶
type VolumeHostPath struct {
Path string `json:"path,omitempty"`
}
VolumeHostPath mounts a file or directory from the host node's filesystem into your container.
type VolumeMount ¶
type VolumeMount struct { Name string `json:"name,omitempty"` MountPath string `json:"path,omitempty" yaml:"path"` }
VolumeMount describes a mounting of a Volume within a container.