jenkins

package
v2.1.155 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 19 Imported by: 5

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

func CheckHealth(url string, healthTimeout time.Duration) error

CheckHealth checks the health of Jenkins server using the login URL

func CreateFolderXML

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

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, handles util.IOFileHandles) (jenkauth.UserAuth, error)

func GetJenkinsClient

func GetJenkinsClient(url string, batch bool, configService jenkauth.ConfigService, handles util.IOFileHandles) (gojenkins.JenkinsClient, error)

func IsMultiBranchProject

func IsMultiBranchProject(job *gojenkins.Job) bool

IsMultiBranchProject returns true if this job is a multi branch project

func IsPipeline

func IsPipeline(j *gojenkins.Job) bool

IsPipeline checks if the job is a pipeline job

func JenkinsApiURL

func JenkinsApiURL(url string) string

func JenkinsLoginURL

func JenkinsLoginURL(url string) string

JenkinsLoginURL returns the Jenkins login URL

func JenkinsTokenURL

func JenkinsTokenURL(url string) string

func JobName

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)

func SwitchJenkinsBaseURL

func SwitchJenkinsBaseURL(jobURL string, baseURL string) string

SwitchJenkinsBaseURL sometimes a Jenkins server does not know its external URL so lets switch the base URL of the job URL to use the known working baseURL of the jenkins server

Types

type CoreVersion

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

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

Dependency a dependency of a plugin

type Developer

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

Developer a developer on a plugin

type PluginRelease

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

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

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

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

LoadUpdateCenterData loads the given UpdateCenter data

func LoadUpdateCenterFile

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

LoadUpdateCenterFile loads the given UpdateCenter JSON file

func LoadUpdateCenterURL

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

LoadUpdateCenterURL loads the given UpdateCenter URL

func (*UpdateCenter) PickPlugins

func (u *UpdateCenter) PickPlugins(currentValues []string, handles util.IOFileHandles) ([]string, error)

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

type Warning

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

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