jobs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package jobs implements common jenkins jobs operations

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorUnexpectedBuildStatus - this is custom error returned when jenkins build has unexpected status
	ErrorUnexpectedBuildStatus = errors.New("unexpected build status")
	// ErrorBuildFailed - this is custom error returned when jenkins build has failed
	ErrorBuildFailed = errors.New("build failed")
	// ErrorAbortBuildFailed - this is custom error returned when jenkins build couldn't be aborted
	ErrorAbortBuildFailed = errors.New("build abort failed")
	// ErrorUnrecoverableBuildFailed - this is custom error returned when jenkins build has failed and cannot be recovered
	ErrorUnrecoverableBuildFailed = errors.New("build failed and cannot be recovered")
	// ErrorNotFound - this is error returned when jenkins build couldn't be found
	ErrorNotFound = errors.New("404")
	// BuildRetires - determines max amount of retires for failed build
	BuildRetires = 3
)

Functions

This section is empty.

Types

type Jobs

type Jobs struct {
	// contains filtered or unexported fields
}

Jobs defines Jobs API tailored for operator sdk

func New

func New(jenkinsClient client.Jenkins, k8sClient k8s.Client, logger logr.Logger) *Jobs

New creates jobs client

func (*Jobs) EnsureBuildJob

func (jobs *Jobs) EnsureBuildJob(jobName, hash string, parameters map[string]string, jenkins *virtuslabv1alpha1.Jenkins, preserveStatus bool) (done bool, err error)

EnsureBuildJob function takes care of jenkins build lifecycle according to the lifecycle of reconciliation loop implementation guarantees that jenkins build can be properly handled even after operator pod restart entire state is saved in Jenkins.Status.Builds section function return 'true' when build finished successfully or false when reconciliation loop should requeue this function preserveStatus determines that build won't be removed from Jenkins.Status.Builds section

Jump to

Keyboard shortcuts

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