jenkins

package
v0.0.0-...-0473bba Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PATH_CREAT                = "/createItem/"
	PATH_DELETE               = "/job/%s/doDelete"                   // /job/{name}/deDelete
	PATH_UPDATE               = "/job/%s/config.xml"                 // appName
	PATH_VIEW_JOB             = "/job/%s/"                           // appName
	PATH_BUILD_WITHPARAMETERS = "/job/%s/buildWithParameters"        // appName
	PATH_LOG_TEXT             = "/job/%s/%d/logText/progressiveText" // appName, jenkins job num
	PATH_JOB_JSON             = "/job/%s/%d/api/json"                // appName, jenkins job num
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// e.g: http://localhost:8080
	Domain string

	// jenkins basic auth username and password
	Username string
	Password string
}

func C

func C() *Client

func (*Client) Config

func (t *Client) Config(domain, username, password string) *Client

func (*Client) CrumbIssuer

func (t *Client) CrumbIssuer() ([]string, error)

Jenkins-Crumb:9dc7abb9785492b95f781a4de469e600 for jenkins CSRF Protection

func (*Client) Job

func (t *Client) Job() *Job

type Job

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

func NewJob

func NewJob(c *Client) *Job

func (*Job) BuildWithParameters

func (t *Job) BuildWithParameters(name string, buildParams map[string]string) error

buildParams = {"BUILD_ID": "1", "BUILD_BRANCH": "master"}

func (*Job) Create

func (t *Job) Create(name, xmlConfig string) error

func (*Job) Delete

func (t *Job) Delete(name string) error

func (*Job) GetLogSize

func (t *Job) GetLogSize(name string, buildNum int) (int, error)

func (*Job) GetStatus

func (t *Job) GetStatus(name string, buildNum int) (string, bool, error)

get job status

func (*Job) GetTextLog

func (t *Job) GetTextLog(name string, buildNum int, limit ...int) (string, error)

get log of the job jenkins job name, jenkins job build number, (limit[0]:start, limit[1]logSize)

func (*Job) IsExist

func (t *Job) IsExist(name string) (bool, error)

func (*Job) Update

func (t *Job) Update(name, xmlConfig string) error

Jump to

Keyboard shortcuts

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