jobs

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 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 = fmt.Errorf("unexpected build status")
	// ErrorBuildFailed - this is custom error returned when jenkins build has failed
	ErrorBuildFailed = fmt.Errorf("build failed")
	// ErrorAbortBuildFailed - this is custom error returned when jenkins build couldn't be aborted
	ErrorAbortBuildFailed = fmt.Errorf("build abort failed")
	// ErrorUnrecoverableBuildFailed - this is custom error returned when jenkins build has failed and cannot be recovered
	ErrorUnrecoverableBuildFailed = fmt.Errorf("build failed and cannot be recovered")
	// ErrorNotFound - this is error returned when jenkins build couldn't be found
	ErrorNotFound = fmt.Errorf("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 *v1alpha1.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