jx: github.com/jenkins-x/jx/pkg/jenkins Index | Files | Directories

package jenkins

import "github.com/jenkins-x/jx/pkg/jenkins"


Package Files

branches.go constants.go health.go jobs.go update_center.go utils.go


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"

func BranchPattern Uses

func BranchPattern(gitKind string) string

func CheckHealth Uses

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

CheckHealth checks the health of Jenkins server using the login URL

func CreateFolderXML Uses

func CreateFolderXML(folderURL string, name string) string

CreateFolderXML creates a Jenkins Folder XML

func CreateMultiBranchProjectXml Uses

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

func CreatePipelineXML Uses

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 Uses

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 Uses

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

func IsMultiBranchProject Uses

func IsMultiBranchProject(job *gojenkins.Job) bool

IsMultiBranchProject returns true if this job is a multi branch project

func IsPipeline Uses

func IsPipeline(j *gojenkins.Job) bool

IsPipeline checks if the job is a pipeline job

func JenkinsApiURL Uses

func JenkinsApiURL(url string) string

func JenkinsLoginURL Uses

func JenkinsLoginURL(url string) string

JenkinsLoginURL returns the Jenkins login URL

func JenkinsTokenURL Uses

func JenkinsTokenURL(url string) string

func JobName Uses

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

JobName returns the Jenkins job name starting with the given prefix

func LoadAllJenkinsJobs Uses

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

LoadAllJenkinsJobs Loads all the jobs in full from the Jenkins client

func PrintGetTokenFromURL Uses

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

func SwitchJenkinsBaseURL Uses

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

type CoreVersion Uses

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 Uses

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

Dependency a dependency of a plugin

type Developer Uses

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

Developer a developer on a plugin

type PluginRelease Uses

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 Uses

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 Uses

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 Uses

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

LoadUpdateCenterData loads the given UpdateCenter data

func LoadUpdateCenterFile Uses

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

LoadUpdateCenterFile loads the given UpdateCenter JSON file

func LoadUpdateCenterURL Uses

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

LoadUpdateCenterURL loads the given UpdateCenter URL

func (*UpdateCenter) PickPlugins Uses

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 Uses

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 Uses

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

WarningVersion warning versions



Package jenkins imports 19 packages (graph). Updated 2020-07-03. Refresh now. Tools for package owners.