builds

package
v0.0.0-...-f64df6f Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package builds relates to Jenkins builds A Jenkins build is an execution of a particular job

Index

Constants

View Source
const (
	Boolean string = "hudson.model.BooleanParameterValue"
	String  string = "hudson.model.StringParameterValue"
	File    string = "hudson.model.FileParameterValue"
)

Possible Parameter Types

Variables

This section is empty.

Functions

func GenerateParametersBody

func GenerateParametersBody(content map[string]string) string

GenerateParametersBody converts a map of parameters into a Jenkins readable format See https://wiki.jenkins.io/display/JENKINS/Remote+access+API

Types

type Artifact

type Artifact struct {
	DisplayPath  string `json:"displayPath"`
	FileName     string `json:"fileName"`
	RelativePath string `json:"relativePath"`
}

Artifact is a build artifact from Jenkins

type Artifacts

type Artifacts []Artifact

Artifacts is a collection of Artifacts. Implements output.Printable

func (*Artifacts) Headers

func (a *Artifacts) Headers() []string

Headers for the default view

func (*Artifacts) JSON

func (a *Artifacts) JSON() []byte

JSON converts to JSON

func (*Artifacts) Rows

func (a *Artifacts) Rows() [][]string

Rows for the default view

type Build

type Build struct {
	Class       string        `json:"_class"`
	Actions     []BuildAction `json:"actions"`
	ID          int           `json:"number"`
	Result      BuildResult   `json:"result"`
	Description string        `json:"description"`
	Timestamp   int64         `json:"timestamp"`
	Duration    int64         `json:"duration"`
	Artifacts   []Artifact    `json:"artifacts"`
}

Build is the execution of a Jenkins job

type BuildAction

type BuildAction struct {
	Class      string            `json:"_class"`
	Parameters *[]BuildParameter `json:"parameters"`
}

BuildAction is an interface for hudson.model.*Action

type BuildParameter

type BuildParameter struct {
	Class string `json:"_class"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

BuildParameter represents a hudson.model.*ParameterValue

func (*BuildParameter) MarshalJSON

func (p *BuildParameter) MarshalJSON() ([]byte, error)

MarshalJSON provides a custom JSON output format for a BuildParameter This means you get {"type": "Boolean"} instead of {"type": <some-java-class-name>} Makes things much nicer to work with

func (*BuildParameter) Type

func (p *BuildParameter) Type() string

Type gets a string representation of the type of the BuildParameter Supported types are booleans, strings and files

type BuildParameters

type BuildParameters []BuildParameter

BuildParameters is the printable array of Parameter Implements output.Printable

func (*BuildParameters) Headers

func (p *BuildParameters) Headers() []string

Headers for the default view

func (*BuildParameters) JSON

func (p *BuildParameters) JSON() []byte

JSON formatted parameters TODO: STUB

func (*BuildParameters) Rows

func (p *BuildParameters) Rows() [][]string

Rows for the default view

type BuildResult

type BuildResult string

BuildResult is an enum of possible Jenkins build results

const (
	Success BuildResult = "SUCCESS"
	Failure BuildResult = "FAILURE"
)

Possible BuildResults

type Builds

type Builds []Build

Builds is an alias for a slice of Build Implements output.Printable

func (*Builds) Headers

func (b *Builds) Headers() []string

Headers returns the headers in the default output Used to implement output.Printable

func (*Builds) JSON

func (b *Builds) JSON() []byte

JSON formats a build as JSON

func (*Builds) Rows

func (b *Builds) Rows() [][]string

Rows returns the rows for the default output format Used to implement output.Printable

Jump to

Keyboard shortcuts

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