Documentation ¶
Index ¶
- Constants
- func BranchPattern(gitKind string) string
- func CheckHealth(url string, healthTimeout time.Duration) error
- func CreateFolderXML(folderURL string, name string) string
- func CreateMultiBranchProjectXml(info *gits.GitRepository, gitProvider gits.GitProvider, credentials string, ...) string
- func CreatePipelineXML(gitURL string, branch string, jenksinsfileName string) string
- func EditUserAuth(url string, configService jenkauth.ConfigService, config *jenkauth.AuthConfig, ...) (jenkauth.UserAuth, error)
- func GetJenkinsClient(url string, batch bool, configService jenkauth.ConfigService, ...) (gojenkins.JenkinsClient, error)
- func IsMultiBranchProject(job *gojenkins.Job) bool
- func IsPipeline(j *gojenkins.Job) bool
- func JenkinsApiURL(url string) string
- func JenkinsLoginURL(url string) string
- func JenkinsTokenURL(url string) string
- func JobName(prefix string, j *gojenkins.Job) string
- func LoadAllJenkinsJobs(jenkinsClient gojenkins.JenkinsClient) ([]*gojenkins.Job, error)
- func PrintGetTokenFromURL(out io.Writer, tokenUrl string) (int, error)
- func SwitchJenkinsBaseURL(jobURL string, baseURL string) string
- type CoreVersion
- type Dependency
- type Developer
- type PluginRelease
- type Signature
- type UpdateCenter
- type Warning
- type WarningVersion
Constants ¶
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 = ".*" )
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 CheckHealth ¶
CheckHealth checks the health of Jenkins server using the login URL
func CreateFolderXML ¶
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 ¶
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 ¶
IsMultiBranchProject returns true if this job is a multi branch project
func IsPipeline ¶
IsPipeline checks if the job is a pipeline job
func JenkinsApiURL ¶
func JenkinsLoginURL ¶
JenkinsLoginURL returns the Jenkins login URL
func JenkinsTokenURL ¶
func LoadAllJenkinsJobs ¶
func LoadAllJenkinsJobs(jenkinsClient gojenkins.JenkinsClient) ([]*gojenkins.Job, error)
LoadAllJenkinsJobs Loads all the jobs in full from the Jenkins client
func SwitchJenkinsBaseURL ¶
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