commands

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MarkerRunning status
	MarkerRunning = "↻"
	// MarkerSuccess status
	MarkerSuccess = "✓"
	// MarkerFailure status
	MarkerFailure = "✗"
	// MarkerDefault status
	MarkerDefault = "?"
	// StatusRunning text
	StatusRunning = "RUNNING"
	// StatusSuccess text
	StatusSuccess = "SUCCESS"
	// StatusFailure text
	StatusFailure = "FAILURE"
)

Variables

View Source
var (
	// Unknown represents the default or unknown status if an error occurs.
	Unknown = yellow("?")
	// Running is use to indicate jobs that are currently running.
	Running = green("↻")
	// Good is a generic status that represents a healthy job/node.
	Good = green("✓")
	// Bad should be used to represent a problem with a job/node.
	Bad = red("✗")
)

Functions

func GetMarker added in v0.5.0

func GetMarker(status string) string

GetMarker for status

Types

type Build

type Build struct {
	// contains filtered or unexported fields
}

Build can be used to kick of new builds of jobs with a name matching the provided regular expression.

func NewBuild

func NewBuild(jenkins *gojenkins.Jenkins, regex string) *Build

NewBuild is a convenience method for initializing a new Build instance.

func (Build) Exec

func (b Build) Exec() error

Exec will send a request to the Jenkins server to start new builds of all jobs with names that match the configured regular expression.

type Diff

type Diff struct {
	// contains filtered or unexported fields
}

Diff is a type that can be used to retrieve the differences between the console output of two different builds.

func NewDiff

func NewDiff(jenkins *gojenkins.Jenkins, jobName string, build1, build2 int64) *Diff

NewDiff is a convenience method for configuring a new Diff instance with the provided job name and build numbers.

func (Diff) Exec

func (d Diff) Exec() error

Exec will get the console output of two jobs and print the differences between the two console output strings.

type Logs

type Logs struct {
	// contains filtered or unexported fields
}

Logs is a type that can be used to access a Jenkins job's logs.

func NewLogs

func NewLogs(jenkins *gojenkins.Jenkins, jobName string, salt bool) *Logs

NewLogs is a convenience method for initializing a new Logs instance.

func (Logs) Exec

func (l Logs) Exec() error

Exec will find a job matching the name in the Logs instance and print the console output. A link to the console text will also be printed so the user can open the console output in the Jenkins dashboard instead.

type Nodes

type Nodes struct {
	// contains filtered or unexported fields
}

Nodes is a type used to request the status of different nodes used by a Jenkins server.

func NewNodes

func NewNodes(jenkins *gojenkins.Jenkins) *Nodes

NewNodes will construct a new Nodes instance with the provided Jenkins client that has previously been configured with valid credentials.

func (Nodes) Exec

func (n Nodes) Exec() error

Exec will request all nodes connected to the configured Jenkins server and prints the status of each node.

type Open

type Open struct {
	// contains filtered or unexported fields
}

Open is a type that can be used to open a job or set of jobs in a browser.

func NewOpen

func NewOpen(jenkins *gojenkins.Jenkins, regex string) *Open

NewOpen is a convenience method for initializing a new Open instance.

func (Open) Exec

func (o Open) Exec() error

Exec will find a list of jobs with a name matching the specified regular expression and will open the page for that job in the system's default web browser.

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

Queue is a type that can be used to get information about a specific build queue.

func NewQueue

func NewQueue(jenkins *gojenkins.Jenkins, regex string, verbose, salt bool) *Queue

NewQueue will intialize a new Queue instance with the provided parameters.

func (Queue) Exec

func (q Queue) Exec() error

Exec will get details about the calling build queue.

type Status

type Status struct {
	// contains filtered or unexported fields
}

Status is a type that is used to get the current build status of a Jenkins job. Including the regex that is used to match the desired job names.

func NewStatus

func NewStatus(jenkins *gojenkins.Jenkins, regex string, onlyFailing bool) *Status

func (Status) Exec

func (s Status) Exec() error

Exec is responsible for finding all of the matching jobs on the Jenkins server and prints the status of each job that matches the provided regular expression.

Jump to

Keyboard shortcuts

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