environment

package
v0.0.0-...-b698297 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2015 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Defines an operational mode where the whole location is cleaned when all files contained inside are expired.
	ModeTTLPerLocation = "TTLPerLocation"
	// Defines an operational mode where indivial files are cleaned as they expire.
	ModeTTLPerFile = "TTLPerFile"
)
View Source
const (
	ClientJarName         = "slave.jar"
	ClientJarDownloadName = "~slave.jar.download"
	ClientJarURL          = "jnlpJars/slave.jar"
)
View Source
const (
	FullGCURL      = "/computer/%s/scriptText"
	FullGCScript   = "3.times{ System.gc() }"
	FullGCPostBody = "script=%s"
)
View Source
const (
	ComputersURI         = "computer/api/xml"
	CreateNodeURI        = "computer/doCreateItem"
	ExpectedNodeType     = "hudson.slaves.DumbSlave$DescriptorImpl"
	ExpectedNodeLauncher = "hudson.slaves.JNLPLauncher"
)
View Source
const (
	MinJavaVersion = "1.6.0"
)
View Source
const (
	NodeMonitoringURI = "computer/%s/api/xml"
)

Variables

View Source
var AllEnvironmentPreparers = []EnvironmentPreparer{}

Contains all registered preparers.

Functions

func RunPreparers

func RunPreparers(config *util.Config)

Runs all registered preparers.

func VisitAllPreparers

func VisitAllPreparers(fn func(EnvironmentPreparer))

Passes all registered preparers to the specified callback.

Types

type AllComputerNames

type AllComputerNames struct {
	XMLName xml.Name `xml:"computerSet"`
	Names   []string `xml:"computer>displayName"`
}

func GetAllRegisteredNodesInJenkins

func GetAllRegisteredNodesInJenkins(config *util.Config) (*AllComputerNames, error)

Returns the names of all nodes that are registered in Jenkins.

type EnvironmentPreparer

type EnvironmentPreparer interface {
	util.ConfigVerifier
	// Returns the name of the mode.
	Name() string
	// Prepares the environment.
	Prepare(config *util.Config)
}

Defines an interface for implementations that prepare or monitor the environment.

func RegisterPreparer

func RegisterPreparer(preparer EnvironmentPreparer) EnvironmentPreparer

Registers a new preparer and returns it.

type FullGCInvoker

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

Defines an object which triggers a periodic restart of the Jenkins client when enabled.

func (*FullGCInvoker) IsConfigAcceptable

func (self *FullGCInvoker) IsConfigAcceptable(config *util.Config) bool

func (*FullGCInvoker) Name

func (self *FullGCInvoker) Name() string

func (*FullGCInvoker) Prepare

func (self *FullGCInvoker) Prepare(config *util.Config)

type JavaDownloader

type JavaDownloader struct {
	util.AnyConfigAcceptor
}

Implements a downloader that ensures that a JDK is installed before either server of client mode is executed.

func (*JavaDownloader) Name

func (self *JavaDownloader) Name() string

func (*JavaDownloader) Prepare

func (self *JavaDownloader) Prepare(config *util.Config)

type JavaInstaller

type JavaInstaller interface {
	InstallJava(config *util.Config) error
}

Defines an interface for implementations that can install java.

type JenkinsClientDownloader

type JenkinsClientDownloader struct {
	util.AnyConfigAcceptor
}

Implements a downloader that ensures that the latest Jenkins client (slave.jar) is downloaded before the client mode starts.

func (*JenkinsClientDownloader) Name

func (self *JenkinsClientDownloader) Name() string

func (*JenkinsClientDownloader) Prepare

func (self *JenkinsClientDownloader) Prepare(config *util.Config)

type JenkinsNodeConfig

type JenkinsNodeConfig struct {
	Name     string `xml:"name"`
	RemoteFS string `xml:"remoteFS"`
}

func GetJenkinsNodeConfig

func GetJenkinsNodeConfig(config *util.Config) (*JenkinsNodeConfig, error)

Returns the current configuration of this Jenkins node from the Jenkins server.

type JenkinsNodeMonitor

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

Implements a monitor that issues a rest call on jenkins to see whether the node is online within jenkins.

func (*JenkinsNodeMonitor) IsConfigAcceptable

func (self *JenkinsNodeMonitor) IsConfigAcceptable(config *util.Config) bool

func (*JenkinsNodeMonitor) Name

func (self *JenkinsNodeMonitor) Name() string

func (*JenkinsNodeMonitor) Prepare

func (self *JenkinsNodeMonitor) Prepare(config *util.Config)

type JenkinsNodeStatus

type JenkinsNodeStatus struct {
	DisplayName        string `xml:"displayName"`
	Idle               bool   `xml:"idle"`
	Offline            bool   `xml:"offline"`
	TemporarilyOffline bool   `xml:"temporarilyOffline"`
}

func GetJenkinsNodeStatus

func GetJenkinsNodeStatus(config *util.Config) (*JenkinsNodeStatus, error)

Returns the current offline and idle status of this Jenkins node from the Jenkins server.

type LocationCleaner

type LocationCleaner struct {
	util.AnyConfigAcceptor
	// contains filtered or unexported fields
}

Defines an object which continuously watches and cleans the temporary directory of files that haven't been modified for maxTTLInTempDirectories (default 24 hours).

func NewLocationCleaner

func NewLocationCleaner() *LocationCleaner

func (*LocationCleaner) Name

func (self *LocationCleaner) Name() string

func (*LocationCleaner) Prepare

func (self *LocationCleaner) Prepare(config *util.Config)

type NodeNameHandler

type NodeNameHandler struct {
	util.AnyConfigAcceptor
}

Defines an object which tries to find the correct node name for the machine that runs the util.

func (*NodeNameHandler) Name

func (self *NodeNameHandler) Name() string

func (*NodeNameHandler) Prepare

func (self *NodeNameHandler) Prepare(config *util.Config)

type OutOfMemoryErrorRestarter

type OutOfMemoryErrorRestarter struct {
	util.AnyConfigAcceptor
	// contains filtered or unexported fields
}

Defines an object which triggers a periodic restart of the Jenkins client when enabled.

func NewOutOfMemoryErrorRestarter

func NewOutOfMemoryErrorRestarter() *OutOfMemoryErrorRestarter

func (*OutOfMemoryErrorRestarter) Name

func (self *OutOfMemoryErrorRestarter) Name() string

func (*OutOfMemoryErrorRestarter) Prepare

func (self *OutOfMemoryErrorRestarter) Prepare(config *util.Config)

type PeriodicRestarter

type PeriodicRestarter struct {
	util.AnyConfigAcceptor
	// contains filtered or unexported fields
}

Defines an object which triggers a periodic restart of the Jenkins client when enabled.

func (*PeriodicRestarter) Name

func (self *PeriodicRestarter) Name() string

func (*PeriodicRestarter) Prepare

func (self *PeriodicRestarter) Prepare(config *util.Config)

type SSHTunnelEstablisher

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

Implements the establishing of an SSH tunnel between the node and the jenkins server.

func NewSSHTunnelEstablisher

func NewSSHTunnelEstablisher(registerInMode bool) *SSHTunnelEstablisher

Creates a new tunnel establisher.

func (*SSHTunnelEstablisher) IsConfigAcceptable

func (self *SSHTunnelEstablisher) IsConfigAcceptable(config *util.Config) bool

func (*SSHTunnelEstablisher) Name

func (self *SSHTunnelEstablisher) Name() string

func (*SSHTunnelEstablisher) Prepare

func (self *SSHTunnelEstablisher) Prepare(config *util.Config)

Jump to

Keyboard shortcuts

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