jenkins

package
v1.3.943 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: Apache-2.0 Imports: 20 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// DefaultJenkinsCredentialsPrefix prefix for jenkins credentials
	DefaultJenkinsCredentialsPrefix = "jenkins-x-"

	// Chartmuseum name for chartmuseum
	Chartmuseum = "chartmuseum"

	// BranchPatternMasterPRsAndFeatures only match master, PRs and features
	BranchPatternMasterPRsAndFeatures = "master|PR-.*|feature.*"

	// BranchPatternMatchEverything matches everything
	BranchPatternMatchEverything = ".*"
)
View Source
const (
	// DefaultUpdateCenterURL the LTS update center metadata URL
	DefaultUpdateCenterURL = "https://updates.jenkins.io/current/update-center.json"
)

Variables

This section is empty.

Functions

func BranchPattern

func BranchPattern(gitKind string) string

func CheckHealth added in v1.3.845

func CheckHealth(url string) error

CheckHealth checks the health of Jenkins server using the login URL

func CreateFolderXML added in v1.3.926

func CreateFolderXML(folderURL string, name string) string

CreateFolderXML creates a Jenkins Folder XML

func CreateMultiBranchProjectXml

func CreateMultiBranchProjectXml(info *gits.GitRepository, gitProvider gits.GitProvider, credentials string, branches string, jenkinsfile string) string

func CreatePipelineXML added in v1.3.926

func CreatePipelineXML(gitURL string, branch string, jenksinsfileName string) string

CreatePipelineXML creates the XML for a stand alone pipeline that is not using the Multi Branch Project

func EditUserAuth

func EditUserAuth(url string, configService jenkauth.ConfigService, config *jenkauth.AuthConfig, auth *jenkauth.UserAuth, tokenUrl string, batchMode bool, in terminal.FileReader, out terminal.FileWriter, outErr io.Writer) (jenkauth.UserAuth, error)

func GetJenkinsClient

func GetJenkinsClient(url string, batch bool, configService jenkauth.ConfigService, in terminal.FileReader, out terminal.FileWriter, outErr io.Writer) (gojenkins.JenkinsClient, error)

func IsMultiBranchProject

func IsMultiBranchProject(job *gojenkins.Job) bool

IsMultiBranchProject returns true if this job is a multi branch project

func IsPipeline added in v1.3.883

func IsPipeline(j *gojenkins.Job) bool

IsPipeline checks if the job is a pipeline job

func JenkinsApiURL

func JenkinsApiURL(url string) string

func JenkinsLoginURL added in v1.3.845

func JenkinsLoginURL(url string) string

JenkinsLoginURL returns the Jenkins login URL

func JenkinsTokenURL

func JenkinsTokenURL(url string) string

func JobName added in v1.3.883

func JobName(prefix string, j *gojenkins.Job) string

JobName returns the Jenkins job name starting with the given prefix

func LoadAllJenkinsJobs

func LoadAllJenkinsJobs(jenkinsClient gojenkins.JenkinsClient) ([]*gojenkins.Job, error)

LoadAllJenkinsJobs Loads all the jobs in full from the Jenkins client

func PrintGetTokenFromURL

func PrintGetTokenFromURL(out io.Writer, tokenUrl string) (int, error)

Types

type CoreVersion added in v1.3.932

type CoreVersion struct {
	BuildDate string `json:"buildDate"`
	Name      string `json:"name"`
	Sha1      string `json:"sha1"`
	Sha256    string `json:"sha256"`
	URL       string `json:"url"`
	Version   string `json:"version"`
}

CoreVersion represents the version of Core

type Dependency added in v1.3.932

type Dependency struct {
	Name     string `json:"name"`
	Optional bool   `json:"optional"`
	Version  string `json:"version"`
}

Dependency a dependency of a plugin

type Developer added in v1.3.932

type Developer struct {
	DeveloperID string `json:"developerId"`
	Email       string `json:"email"`
	Name        string `json:"name"`
}

Developer a developer on a plugin

type PluginRelease added in v1.3.932

type PluginRelease struct {
	BuildDate    string       `json:"buildDate"`
	Dependencies []Dependency `json:"dependencies"`

	Developers        []Developer `json:"developers"`
	Excerpt           string      `json:"excerpt"`
	Gav               string      `json:"gav"`
	Labels            []string    `json:"labels"`
	Name              string      `json:"name"`
	PreviousTimestamp string      `json:"previousTimestamp"`
	PreviousVersion   string      `json:"previousVersion"`
	ReleaseTimestamp  string      `json:"releaseTimestamp"`
	RequiredCore      string      `json:"requiredCore"`
	Scm               string      `json:"scm"`
	Sha1              string      `json:"sha1"`
	Sha256            string      `json:"sha256"`
	Title             string      `json:"title"`
	URL               string      `json:"url"`
	Version           string      `json:"version"`
	Wiki              string      `json:"wiki"`
}

PluginRelease represets the data for a plugin

type Signature added in v1.3.932

type Signature struct {
	Certificates        []string `json:"certificates"`
	CorrectDigest       string   `json:"correct_digest"`
	CorrectDigest512    string   `json:"correct_digest512"`
	CorrectSignature    string   `json:"correct_signature"`
	CorrectSignature512 string   `json:"correct_signature512"`
	Digest              string   `json:"digest"`
	Digest512           string   `json:"digest512"`
	Signature           string   `json:"signature"`
	Signature512        string   `json:"signature512"`
}

Signature signature metadata

type UpdateCenter added in v1.3.932

type UpdateCenter struct {
	ConnectionCheckURL  string                   `json:"connectionCheckUrl"`
	Core                CoreVersion              `json:"core"`
	ID                  string                   `json:"id"`
	Plugins             map[string]PluginRelease `json:"plugins"`
	Signature           Signature                `json:"signature"`
	UpdateCenterVersion string                   `json:"updateCenterVersion"`
	Warnings            []Warning                `json:"warnings"`
}

UpdateCenter represents the Update Center metadata returned from URLs like https://updates.jenkins.io/current/update-center.json

func LoadUpdateCenterData added in v1.3.932

func LoadUpdateCenterData(data []byte) (*UpdateCenter, error)

LoadUpdateCenterData loads the given UpdateCenter data

func LoadUpdateCenterFile added in v1.3.932

func LoadUpdateCenterFile(fileName string) (*UpdateCenter, error)

LoadUpdateCenterFile loads the given UpdateCenter JSON file

func LoadUpdateCenterURL added in v1.3.932

func LoadUpdateCenterURL(u string) (*UpdateCenter, error)

LoadUpdateCenterURL loads the given UpdateCenter URL

func (*UpdateCenter) PickPlugins added in v1.3.932

func (u *UpdateCenter) PickPlugins(currentValues []string, in terminal.FileReader, out terminal.FileWriter, outErr io.Writer) ([]string, error)

PickPlugins provides the user with a list of plugins that can be added to a Jenkins App

type Warning added in v1.3.932

type Warning struct {
	ID       string           `json:"id"`
	Message  string           `json:"message"`
	Name     string           `json:"name"`
	Type     string           `json:"type"`
	URL      string           `json:"url"`
	Versions []WarningVersion `json:"versions"`
}

Warning a warning message

type WarningVersion added in v1.3.932

type WarningVersion struct {
	FirstVersion string `json:"firstVersion"`
	LastVersion  string `json:"lastVersion"`
	Pattern      string `json:"pattern"`
}

WarningVersion warning versions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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