jenkins

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: MIT Imports: 12 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

jenkins

Go package containing various Jenkins tools built on the Jenkins REST API.

Installation

 make

Use

 $ go get github.com/xoom/jenkins


 import "github.com/xoom/jenkins"

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Branch

type Branch struct {
	XMLName xml.Name `xml:"hudson.plugins.git.BranchSpec"`
	Name    string   `xml:"name"`
}

type Branches

type Branches struct {
	XMLName xml.Name `xml:"branches"`
	Branch  []Branch `xml:"hudson.plugins.git.BranchSpec"`
}

type Client

type Client struct {
	Jenkins
	// contains filtered or unexported fields
}

func (Client) CreateJob

func (client Client) CreateJob(jobName, jobConfigXML string) error

CreateJob creates a Jenkins job with the given name for the given XML job config.

func (Client) DeleteJob

func (client Client) DeleteJob(jobName string) error

DeleteJob creates a Jenkins job with the given name for the given XML job config.

func (Client) GetJobConfig

func (client Client) GetJobConfig(jobName string) (JobConfig, error)

GetJobConfig retrieves the Jenkins jobs config for the named job.

func (Client) GetJobSummaries

func (client Client) GetJobSummaries() ([]JobSummary, error)

func (Client) GetJobSummariesFromFilesystem

func (client Client) GetJobSummariesFromFilesystem(root string) ([]JobSummary, error)

func (Client) GetJobs

func (client Client) GetJobs() (map[string]JobDescriptor, error)

GetJobs retrieves the set of Jenkins jobs as a map indexed by job name.

func (Client) GetLastBuild

func (client Client) GetLastBuild(jobName string) (LastBuild, error)

GetLastBuild retrieves the last build by job name

type FreeStyleJobConfig

type FreeStyleJobConfig struct {
	XMLName xml.Name `xml:"project"`
	SCM     Scm      `xml:"scm"`
	JobName string
}

Freestyle project

type Jenkins

type Jenkins interface {
	GetJobs() (map[string]JobDescriptor, error)
	GetJobConfig(jobName string) (JobConfig, error)
	GetJobSummaries() ([]JobSummary, error)
	GetJobSummariesFromFilesystem(root string) ([]JobSummary, error)
	GetLastBuild(jobName string) (LastBuild, error)
	CreateJob(jobName, jobConfigXML string) error
	DeleteJob(jobName string) error
}

func NewClient

func NewClient(baseURL *url.URL, username, password string) Jenkins

type JobConfig

type JobConfig struct {
	XMLName    xml.Name   `xml:"maven2-moduleset"`
	SCM        Scm        `xml:"scm"`
	Publishers Publishers `xml:"publishers"`
	RootModule RootModule `xml:"rootModule"`
	JobName    string
}

Maven project

type JobDescriptor

type JobDescriptor struct {
	Name  string `json:"name"`
	Color string `json:"color"`
	URL   string `json:"url"`
}

type JobSummary

type JobSummary struct {
	JobDescriptor JobDescriptor
	JobType       JobType
	GitURL        string // the use of this field is deprecated
	Branch        string // the use of this field is deprecated
}

Model of both Maven and Freestyle job types

type JobType

type JobType int
const (
	Maven JobType = iota
	Freestyle
	Unknown
)

type Jobs

type Jobs struct {
	Jobs []JobDescriptor `json:"jobs"`
}

type LastBuild

type LastBuild struct {
	Result          string `json:"result"`
	TimestampMillis int64  `json:"timestamp"`
	URL             string `json:"url"`
}

type Publishers

type Publishers struct {
	XMLName            xml.Name            `xml:"publishers"`
	RedeployPublishers []RedeployPublisher `xml:"hudson.maven.RedeployPublisher"`
}

type RedeployPublisher

type RedeployPublisher struct {
	XMLName xml.Name `xml:"hudson.maven.RedeployPublisher"`
	URL     string   `xml:"url"`
}

type RootModule

type RootModule struct {
	XMLName    xml.Name `xml:"rootModule"`
	GroupID    string   `xml:"groupId"`
	ArtifactID string   `xml:"artifactId"`
}

type Scm

type Scm struct {
	XMLName           xml.Name          `xml:"scm"`
	Class             string            `xml:"class,attr"`
	UserRemoteConfigs UserRemoteConfigs `xml:"userRemoteConfigs"`
	Branches          Branches          `xml:"branches"`
}

type UserRemoteConfig

type UserRemoteConfig struct {
	XMLName xml.Name `xml:"hudson.plugins.git.UserRemoteConfig"`
	URL     string   `xml:"url"`
}

type UserRemoteConfigs

type UserRemoteConfigs struct {
	XMLName          xml.Name           `xml:"userRemoteConfigs"`
	UserRemoteConfig []UserRemoteConfig `xml:"hudson.plugins.git.UserRemoteConfig"`
}

Jump to

Keyboard shortcuts

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