Documentation ¶
Index ¶
- func Instance(ctx context.Context, client *http.Client, jenkinsURL, user, token string) (*gojenkins.Jenkins, error)
- func TriggerJob(ctx context.Context, jenkins Jenkins, job Job, parameters map[string]string) (*gojenkins.Build, error)
- func UpdateCredential(ctx context.Context, credentialsManager CredentialsManager, domain string, ...) error
- func WaitForBuildToFinish(ctx context.Context, build Build, pollInterval time.Duration) error
- type Artifact
- type ArtifactImpl
- type Build
- type CredentialsManager
- type DockerServerCredentials
- type Jenkins
- type Job
- type JobImpl
- type SSHCredentials
- type StringCredentials
- type Task
- type TaskImpl
- type UsernameCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Instance ¶
func Instance(ctx context.Context, client *http.Client, jenkinsURL, user, token string) (*gojenkins.Jenkins, error)
Instance connects to a Jenkins instance and returns a handler.
func TriggerJob ¶
func TriggerJob(ctx context.Context, jenkins Jenkins, job Job, parameters map[string]string) (*gojenkins.Build, error)
TriggerJob starts a build for a given job name.
func UpdateCredential ¶ added in v1.108.0
func UpdateCredential(ctx context.Context, credentialsManager CredentialsManager, domain string, credential interface{}) error
UpdateCredential overwrites an existing credential
Types ¶
type Artifact ¶
type Artifact interface { Save(ctx context.Context, path string) (bool, error) SaveToDir(ctx context.Context, dir string) (bool, error) GetData(ctx context.Context) ([]byte, error) FileName() string }
Artifact is an interface to abstract gojenkins.Artifact.
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(ctx context.Context) ([]byte, error)
GetData refers to the gojenkins.Artifact.GetData function.
type Build ¶
type Build interface { GetArtifacts() []gojenkins.Artifact IsRunning(ctx context.Context) bool Poll(ctx context.Context, options ...interface{}) (int, error) }
Build is an interface to abstract gojenkins.Build.
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 { GetJobObj(ctx context.Context, name string) *gojenkins.Job BuildJob(ctx context.Context, name string, params map[string]string) (int64, error) GetBuildFromQueueID(ctx context.Context, job *gojenkins.Job, queueid int64) (*gojenkins.Build, error) }
Jenkins is an interface to abstract gojenkins.Jenkins.
type Job ¶ added in v1.146.0
type Job interface { Poll(context.Context) (int, error) InvokeSimple(ctx context.Context, params map[string]string) (int64, error) GetJob() *gojenkins.Job }
Task is an interface to abstract gojenkins.Task.
type JobImpl ¶ added in v1.146.0
JobImpl is a wrapper struct for gojenkins.Task that respects the Task interface.
func (*JobImpl) InvokeSimple ¶ added in v1.146.0
InvokeSimple refers to the gojenkins.Job.InvokeSimple function.
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(context.Context) (int, error) BuildNumber() (int64, error) HasStarted() bool WaitToStart(ctx context.Context, 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