drone

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: Apache-2.0 Imports: 3 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	// Branch defines the branch name of the build.
	Branch string

	// PullRequest number of the build.
	PullRequest int

	// Tag of the build.
	Tag string

	// SourceBranch for the pull request.
	SourceBranch string

	// TargetBranch for the pull request.
	TargetBranch string

	// Number for the build.
	Number int

	// Parent build number for the build.
	Parent int

	// Event that triggered the build.
	Event string

	// Action that triggered the build. This value is used to differentiate
	// bettween a pull request being opened vs synchronized.
	Action string

	// Status of the build.
	Status string

	// Created time of the build.
	Created time.Time

	// Started time of the build.
	Started time.Time

	// Finished time of the build.
	Finished time.Time

	// DeployTo the environment.
	DeployTo string

	// FailedStages of the build.
	FailedStages []string

	// FailedSteps of the build.
	FailedSteps []string
}

Build represents a build of a repository.

type Commit

type Commit struct {
	// SHA for the current commit.
	SHA string

	// Before contains the commit sha before the patch is applied.
	Before string

	// After contains the commit sha after the patch is applied.
	After string

	// Ref for the current commit.
	Ref string

	// Branch target for the push or pull request. This may be empty for
	// tag events.
	Branch string

	// Link to the commit or object in the source control management system.
	Link string

	// Message for the current commit.
	Message string

	// Author of the commit.
	Author string

	// AuthorName of the commit.
	AuthorName string

	// AuthorEmail of the commit.
	AuthorEmail string

	// AuthorAvatar of the commit.
	AuthorAvatar string
}

Commit represents the current commit being built.

type Network

type Network struct {
	// Context for making network requests.
	//
	// If `trace` logging is requested the context will use `httptrace` to
	// capture all network requests.
	Context context.Context

	/// Whether SSL verification is skipped
	SkipVerify bool

	// Client for making network requests.
	Client *http.Client
}

Network contains options for connecting to the network.

type Pipeline

type Pipeline struct {
	Build  Build
	Repo   Repo
	Commit Commit
	Stage  Stage
	Step   Step
	SemVer SemVer
	System System
}

Pipeline being executed.

Represents the full Drone environment that the plugin is executing in.

type Plugin

type Plugin interface {
	// Validate checks the inputs to the Plugin and verifies that the
	// configuration is correct before executing.
	//
	// An error is returned if there are any issues with the current
	// configuration, such as missing information or files not being
	// present. A Plugin may choose to populate additional information to
	// ensure a successful execution, for example if a URL is parsed
	// successfully it can be stored off for later use.
	//
	// Validate needs to be called before Execute.
	Validate() error

	// Execute runs the plugin in the current configuration.
	//
	// An error is returned if the Plugin did not run successfully that
	// describes the runtime error.
	//
	// Execute needs to be called after Validate.
	Execute() error
}

Plugin is an interface for a Drone plugin written in Go.

This is a higly opinionated interface for what a Plugin should do. Its not required that a plugin author follow it.

type Repo

type Repo struct {
	// Slug for the full name of a repo.
	Slug string

	// SCM for the used SCM.
	SCM string

	// Owner for the repo owner.
	Owner string

	// Name for the repo name.
	Name string

	// Link for the link to the repo.
	Link string

	// Branch for the default branch of the repo.
	Branch string

	// HTTPURL for the clone URL via HTTP.
	HTTPURL string

	// SSHURL for the clone URL via SSH
	SSHURL string

	// Visbility for the visbility of the repo.
	Visibility string

	// Private to show if the repo is private.
	Private bool
}

Repo represents the repository for the build.

type SemVer

type SemVer struct {
	// Version is the full semantic version.
	Version string

	// Major version number.
	Major string

	// Minor version number.
	Minor string

	// Patch version number.
	Patch string

	// Prerelease version.
	Prerelease string

	// Build version number.
	//
	// This is signified by a + at the end of the tag.
	Build string

	// Short version of the semantic version string where labels and
	// metadata are truncated.
	Short string

	// Error is the semantic version parsing error if the tag was invalid.
	Error string
}

SemVer represents the semantic version of the currently running build.

This value is only applicable for tags. If the tag cannot be parsed into a semantic version then SemVer.Error will have the reason.

type Stage

type Stage struct {
	// Kind is the kind of resource being executed.
	//
	// This value is sourced from the `kind` attribute in the yaml
	// configuration file
	Kind string

	// Type is the type of resource being executed.
	Type string

	// Name is the name for the current running build stage.
	Name string

	// Number is the stage number for the current running build stage.
	Number int

	// Machine provides the name of the host machine on which the build
	// stage is currently running.
	Machine string

	// OS is the target operating system for the current build stage.
	OS string

	// Arch is the platform architecture of the current build stage.
	Arch string

	// Variant is the target architecture variant for the current build
	// stage.
	Variant string

	// Version is OS version for the current build stage.
	Version string

	// Status is the status for the current running build stage.
	//
	// If all of the stage's steps are passing, the status defaults to
	// success.
	Status string

	// Started is the unix timestamp for when a build stage was started by
	// the runner.
	Started time.Time

	// Finished is the unix timestamp for when the pipeline is finished.
	//
	// A running pipleine cannot have a finish timestamp, therefore, the
	// system aways sets this value to the current timestamp.
	Finished time.Time

	// DependsOn is a list of dependencies for the current build stage.
	DependsOn []string
}

Stage represents a build stage.

type Step

type Step struct {
	// Name for the name of the current step.
	Name string

	// Number is the numeric value of the step.
	Number int
}

Step represents the currently running step within the stage.

type System

type System struct {
	// Proto for the system protocol.
	Proto string

	// Host for the system host name.
	Host string

	// Version for the system version.
	Version string
}

System represents the available system variables.

Jump to

Keyboard shortcuts

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