Documentation ¶
Index ¶
- func Instance(client *http.Client, jenkinsURL, user, token string) (*gojenkins.Jenkins, error)
- func TriggerJob(jenkins Jenkins, jobName string, parameters map[string]string) (*gojenkins.Task, error)
- func UpdateCredential(credentialsManager CredentialsManager, domain string, credential interface{}) error
- func WaitForBuildToFinish(build Build, pollInterval time.Duration)
- func WaitForBuildToStart(jenkins Jenkins, jobName string, taskWrapper Task, pollInterval time.Duration) (*gojenkins.Build, error)
- type Artifact
- type ArtifactImpl
- type Build
- type CredentialsManager
- type DockerServerCredentials
- type Jenkins
- type SSHCredentials
- type StringCredentials
- type Task
- type TaskImpl
- type UsernameCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TriggerJob ¶
func TriggerJob(jenkins Jenkins, jobName string, parameters map[string]string) (*gojenkins.Task, error)
TriggerJob starts a build for a given job name.
func UpdateCredential ¶ added in v1.108.0
func UpdateCredential(credentialsManager CredentialsManager, domain string, credential interface{}) error
UpdateCredential overwrites an existing credential
func WaitForBuildToFinish ¶
WaitForBuildToFinish waits till a build is finished.
Types ¶
type Artifact ¶
type Artifact interface { Save(path string) (bool, error) SaveToDir(dir string) (bool, error) GetData() ([]byte, error) FileName() string }
Artifact is an interface to abstract gojenkins.Artifact. mock generated with: mockery --name Artifact --dir pkg/jenkins --output pkg/jenkins/mocks
type ArtifactImpl ¶
type ArtifactImpl struct {
// contains filtered or unexported fields
}
ArtifactImpl is a wrapper struct for gojenkins.Artifact that respects the Artifact interface.
func (*ArtifactImpl) FileName ¶
func (a *ArtifactImpl) FileName() string
FileName refers to the gojenkins.Artifact.FileName field.
func (*ArtifactImpl) GetData ¶
func (a *ArtifactImpl) GetData() ([]byte, error)
GetData refers to the gojenkins.Artifact.GetData function.
type CredentialsManager ¶ added in v1.108.0
CredentialsManager is utility to control credential plugin
func NewCredentialsManager ¶ added in v1.108.0
func NewCredentialsManager(jenkins *gojenkins.Jenkins) CredentialsManager
NewCredentialsManager returns a new CredentialManager
type DockerServerCredentials ¶ added in v1.108.0
type DockerServerCredentials = gojenkins.DockerServerCredentials
DockerServerCredentials store credentials for docker keys.
type Jenkins ¶
type Jenkins interface { BuildJob(name string, options ...interface{}) (int64, error) GetQueueItem(id int64) (*gojenkins.Task, error) GetBuild(jobName string, number int64) (*gojenkins.Build, error) }
Jenkins is an interface to abstract gojenkins.Jenkins.
type SSHCredentials ¶ added in v1.108.0
type SSHCredentials = gojenkins.SSHCredentials
SSHCredentials store credentials for ssh keys.
type StringCredentials ¶ added in v1.108.0
type StringCredentials = gojenkins.StringCredentials
StringCredentials store only secret text
type Task ¶
type Task interface { Poll() (int, error) BuildNumber() (int64, error) HasStarted() bool WaitToStart(pollInterval time.Duration) (int64, error) }
Task is an interface to abstract gojenkins.Task.
type TaskImpl ¶
TaskImpl is a wrapper struct for gojenkins.Task that respects the Task interface.
func (*TaskImpl) BuildNumber ¶
BuildNumber returns the assigned build number or an error if the build has not yet started.
func (*TaskImpl) HasStarted ¶
HasStarted checks if the wrapped gojenkins.Task has started by checking the assigned executable URL.
type UsernameCredentials ¶ added in v1.108.0
type UsernameCredentials = gojenkins.UsernameCredentials
UsernameCredentials struct representing credential for storing username-password pair