Documentation ¶
Index ¶
- type Config
- type Jenkins
- func (j *Jenkins) AddJobToView(viewName string, jobName string) error
- func (j *Jenkins) CreateJob(xmlFile string, jobName string) error
- func (j *Jenkins) CreateView(viewName string, viewType string) error
- func (j *Jenkins) DeleteJob(jobName string) error
- func (j *Jenkins) DownloadArtifacts(jobName string, buildID int64, pathToSave string) error
- func (j *Jenkins) GetLastBuild(jobName string) error
- func (j *Jenkins) GetLastCompletedBuild(jobName string) error
- func (j *Jenkins) GetLastFailedBuild(jobName string) error
- func (j *Jenkins) GetLastStableBuild(jobName string) error
- func (j *Jenkins) GetLastSuccessfulBuild(jobName string) error
- func (j *Jenkins) GetLastUnstableBuild(jobName string) error
- func (j *Jenkins) Init(config Config) error
- func (j *Jenkins) JobGetConfig(jobName string) error
- func (j *Jenkins) PluginsShow()
- func (j *Jenkins) ServerInfo() error
- func (j *Jenkins) ShowAllJobs() error
- func (j *Jenkins) ShowBuildQueue() error
- func (j *Jenkins) ShowNodes(showStatus string) ([]string, error)
- func (j *Jenkins) ShowStatus(object string)
- func (j *Jenkins) ShowViews() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Server string `mapstructure: Server` JenkinsUser string `mapstructure: JenkinsUser` Token string `mapstructure: Token` ConfigPath string ConfigFileName string ConfigFullPath string }
Config is focused in the configuration json file
func (*Config) LoadConfig ¶
LoadConfig read the JSON configuration from specified file
Example file:
$HOME/.config/jenkinsctl/config.json
Args:
Returns
nil or error
func (*Config) SetConfigPath ¶
SetConfigPath set the default config path
Args:
Returns
string or error
type Jenkins ¶
type Jenkins struct { Instance *gojenkins.Jenkins Server string JenkinsUser string Token string Context context.Context }
Jenkins connection object
func (*Jenkins) AddJobToView ¶
AddJobToView will add a specific job to a view
func (*Jenkins) CreateJob ¶
CreateJob will create a job based on XML specification
Args:
xmlFile - Job described in XML format jobName - Job Name
Returns:
error or nil
func (*Jenkins) CreateView ¶
CreateView will create a view
Args:
viewname - view name viewType - view type
Returns
error or nil
func (*Jenkins) DeleteJob ¶
DeleteJob will delete a job
Args:
jobName - job name
Returns:
error or nil
func (*Jenkins) DownloadArtifacts ¶
DownloadArtifacts will download artifacts
Args:
jobName - job name buildID - build ID pathToSave - path to save artifact
Returns:
error or nil
func (*Jenkins) GetLastBuild ¶
GetLastBuild will get last build
Args:
jobName - Job Name
Returns:
error or nil
func (*Jenkins) GetLastCompletedBuild ¶
GetLastCompletedBuild get last completed build
Args:
jobName - Job Name
Returns:
error or nil
func (*Jenkins) GetLastFailedBuild ¶
GetLastFailedBuild will get last failed build
Args:
jobName - Job Name
Returns:
error or nil
func (*Jenkins) GetLastStableBuild ¶
GetLastStableBuild will get last stable build
Args:
jobName - Job Name
Returns:
error or nil
func (*Jenkins) GetLastSuccessfulBuild ¶
GetLastSuccessfulBuild will get last failed build
Args:
jobName - Job Name
Returns:
error or nil
func (*Jenkins) GetLastUnstableBuild ¶
GetLastUnstableBuild will get last unstable build
Args:
jobName - Job Name
Returns:
error or nil
func (*Jenkins) JobGetConfig ¶
JobGetConfig get the configuration from job
Args:
jobName - job name
Returns:
error or nil
func (*Jenkins) PluginsShow ¶
func (j *Jenkins) PluginsShow()
PluginsShow show all plugins installed and enabled
Returns
nil or error
func (*Jenkins) ShowNodes ¶
ShowNodes show all plugins installed and enabled
Args:
showStatus - show only the
Returns
code return, nil or error
func (*Jenkins) ShowStatus ¶
ShowStatus will show the statys of object TIP: Meaning of collors: https://github.com/jenkinsci/jenkins/blob/5e9b451a11926e5b42d4a94612ca566de058f494/core/src/main/java/hudson/model/BallColor.java#L56