screwdriver

package
v6.0.17+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: BSD-3-Clause Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Running BuildStatus = "RUNNING"
	Success             = "SUCCESS"
	Failure             = "FAILURE"
	Aborted             = "ABORTED"
)

These are the set of valid statuses that a build can be set to

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	BuildFromID(buildID int) (Build, error)
	EventFromID(eventID int) (Event, error)
	JobFromID(jobID int) (Job, error)
	PipelineFromID(pipelineID int) (Pipeline, error)
	UpdateBuildStatus(status BuildStatus, meta map[string]interface{}, buildID int) error
	UpdateStepStart(buildID int, stepName string) error
	UpdateStepStop(buildID int, stepName string, exitCode int) error
	SecretsForBuild(build Build) (Secrets, error)
	GetAPIURL() (string, error)
	GetCoverageInfo() (Coverage, error)
	GetBuildToken(buildID int, buildTimeoutMinutes int) (string, error)
}

API is a Screwdriver API endpoint

func New

func New(url, token string) (API, error)

New returns a new API object

type Build

type Build struct {
	ID            int                    `json:"id"`
	JobID         int                    `json:"jobId"`
	SHA           string                 `json:"sha"`
	Commands      []CommandDef           `json:"steps"`
	Environment   []map[string]string    `json:"environment"`
	ParentBuildID IntOrArray             `json:"parentBuildId"`
	Meta          map[string]interface{} `json:"meta"`
	EventID       int                    `json:"eventId"`
}

Build is a Screwdriver Build

type BuildStatus added in v1.0.23

type BuildStatus string

BuildStatus is the status of a Screwdriver build

func (BuildStatus) String added in v1.0.30

func (b BuildStatus) String() string

type BuildStatusPayload added in v1.0.30

type BuildStatusPayload struct {
	Status string                 `json:"status"`
	Meta   map[string]interface{} `json:"meta"`
}

BuildStatusPayload is a Screwdriver Build Status payload.

type BuildTokenPayload

type BuildTokenPayload struct {
	BuildTimeout int `json:"buildTimeout"`
}

BuildTokenPayload is a Screwdriver Build Token payload.

type CommandDef added in v1.0.26

type CommandDef struct {
	Name string `json:"name"`
	Cmd  string `json:"command"`
}

CommandDef is the definition of a single executable command.

type Coverage

type Coverage struct {
	EnvVars map[string]string `json:"envVars"`
}

Coverage is a Coverage object returned when getInfo is called

type Emitter added in v1.0.42

type Emitter interface {
	StartCmd(cmd CommandDef)
	io.WriteCloser
	Error() error
}

Emitter is an io.WriteCloser that knows about CommandDef

func NewEmitter added in v1.0.42

func NewEmitter(path string) (Emitter, error)

NewEmitter returns an emitter object from an emitter destination path

type Event

type Event struct {
	ID            int                    `json:"id"`
	Meta          map[string]interface{} `json:"meta"`
	ParentEventID int                    `json:"parentEventId"`
}

Event is a Screwdriver Event

type IntOrArray

type IntOrArray interface{}

Need a generic interface to take in an int or array of ints

type Job added in v1.0.6

type Job struct {
	ID            int    `json:"id"`
	PipelineID    int    `json:"pipelineId"`
	Name          string `json:"name"`
	PrParentJobID int    `json:"prParentJobId"`
}

Job is a Screwdriver Job.

type Pipeline added in v1.0.7

type Pipeline struct {
	ID      int     `json:"id"`
	ScmRepo ScmRepo `json:"scmRepo"`
	ScmURI  string  `json:"scmUri"`
}

Pipeline is a Screwdriver Pipeline definition.

type SDError added in v1.0.15

type SDError struct {
	StatusCode int    `json:"statusCode"`
	Reason     string `json:"error"`
	Message    string `json:"message"`
}

SDError is an error response from the Screwdriver API

func (SDError) Error added in v1.0.15

func (e SDError) Error() string

type ScmRepo

type ScmRepo struct {
	Name string `json:"name"`
}

ScmRepo contains the full name of the repository for a Pipeline, e.g. "screwdriver-cd/launcher"

type Secret added in v1.1.2

type Secret struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Secret is a Screwdriver build secret.

type Secrets added in v1.1.2

type Secrets []Secret

Secrets is the collection of secrets for a Screwdriver build

type StepStartPayload added in v1.0.45

type StepStartPayload struct {
	StartTime time.Time `json:"startTime"`
}

StepStartPayload is a Screwdriver Step Start payload.

type StepStopPayload added in v1.0.45

type StepStopPayload struct {
	EndTime  time.Time `json:"endTime"`
	ExitCode int       `json:"code"`
}

StepStopPayload is a Screwdriver Step Stop payload.

type Token

type Token struct {
	Token string `json:"token"`
}

Token is a Screwdriver API token.

Jump to

Keyboard shortcuts

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