jenkins

package
v0.0.0-...-530d8eb Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNewJobName

func GetNewJobName(job, namespace string) string

GetNewJobName return the name of the job with the namespace prefix

Types

type ContinousIntegration

type ContinousIntegration interface {
	User() string
	Password() string
	Url() string
	JobsWithParameters() *JobsParameters
}

type JenkinsClient

type JenkinsClient struct {
	Config *JenkinsClientConfig
	Client *gojenkins.Jenkins
}

JenkinsClient struct with config inherited from JenkinsClientConfig and native client of gojenkins

func NewJenkinsClient

func NewJenkinsClient(v *viper.Viper) *JenkinsClient

NewJenkinsClient initialize the client jenkins

func (*JenkinsClient) ConfigureJobs

func (c *JenkinsClient) ConfigureJobs(j *JobsParameters, namespace string) (map[string]string, error)

ConfigureJobs is a function that implements JenkinsClient, takes JobsParameters and return ....

func (*JenkinsClient) DeleteFolder

func (c *JenkinsClient) DeleteFolder(folderName string) error

DeleteFolder is a function that takes folderName as parameter and delete the specified jenkins folder with jobs inside

func (*JenkinsClient) GetJobStatus

func (c *JenkinsClient) GetJobStatus(namespace string) (JobsStatuses, error)

func (*JenkinsClient) GetRepos

func (c *JenkinsClient) GetRepos() []string

func (*JenkinsClient) ReplayJob

func (c *JenkinsClient) ReplayJob(job, repo, branch, namespace string) error

type JenkinsClientConfig

type JenkinsClientConfig struct {
	URI                    string `json:"jenkins_uri" yaml:"jenkins_uri"`
	Username               string `json:"jenkins_username" yaml:"jenkins_username"`
	Password               string `json:"jenkins_password" yaml:"jenkins_password"`
	FolderTemplate         string `json:"folder_template" yaml:"folder_template"`
	RepositoriesProperties `json:"repositoriesProperties" yaml:"repositoriesProperties"`
	// contains filtered or unexported fields
}

JenkinsClientConfig struct that describe

type JenkinsItem

type JenkinsItem struct {
	Folder bool
	Job    bool
}

type JenkinsJobConfig

type JenkinsJobConfig struct {
	JenkinsJob   string `json:"jenkinsJob,omitempty" yaml:"jenkinsJob,omitempty" mapstructure:"jenkinsJob,omitempty"`
	JenkinsToken string `json:"jenkinsToken,omitempty" yaml:"jenkinsToken,omitempty" mapstructure:"jenkinsToken,omitempty"`
}

JenkinsJobConfig is a struct that describe the needed element for implementing the jenkins api calls

type JobsParameters

type JobsParameters struct {
	Stable           bool
	CommitPerProject git.CommitSpec
}

JobsParameters is the struct needed by a continuous integration service to configure parametrized jobs

type JobsStatuses

type JobsStatuses map[string]string

type RepositoriesProperties

type RepositoriesProperties struct {
	Conf map[string]JenkinsJobConfig `mapstructure:"conf"`
}

RepositoriesProperties is needed for the output of the api `/api/repos` in the format: { "portal": [

{
 "branch": "REF-1415-put-me-beneficiaries",
 "sha": "89b49d796e4028e078d0b743bbcc0e6f4641334d",
 "comment": "Add fake response from beneficiaryService. Testing"
},
{
 "branch": "add-validity-date-to-employee-order-api",
 "sha": "2dd8e54b12e386b3e4649e9545b125b05ff70393",
 "comment": "Present also employeeOrderValidityDate in /employee-orders/{id} api"
}

] } RepositoriesProperties is a struct of an hash composed by string and JenkinsConfig struct inherited

Jump to

Keyboard shortcuts

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