Documentation ¶
Index ¶
- Constants
- Variables
- func RunPreparers(config *util.Config)
- func VisitAllPreparers(fn func(EnvironmentPreparer))
- type AllComputerNames
- type EnvironmentPreparer
- type FullGCInvoker
- type JavaDownloader
- type JavaInstaller
- type JenkinsClientDownloader
- type JenkinsNodeConfig
- type JenkinsNodeMonitor
- type JenkinsNodeStatus
- type LocationCleaner
- type NodeNameHandler
- type OutOfMemoryErrorRestarter
- type PeriodicRestarter
- type SSHTunnelEstablisher
Constants ¶
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" )
const ( ClientJarName = "slave.jar" ClientJarDownloadName = "~slave.jar.download" ClientJarURL = "jnlpJars/slave.jar" )
const ( FullGCURL = "/computer/%s/scriptText" FullGCScript = "3.times{ System.gc() }" FullGCPostBody = "script=%s" )
const ( ComputersURI = "computer/api/xml" CreateNodeURI = "computer/doCreateItem" ExpectedNodeType = "hudson.slaves.DumbSlave$DescriptorImpl" ExpectedNodeLauncher = "hudson.slaves.JNLPLauncher" )
const (
MinJavaVersion = "1.6.0"
)
const (
NodeMonitoringURI = "computer/%s/api/xml"
)
Variables ¶
var AllEnvironmentPreparers = []EnvironmentPreparer{}
Contains all registered preparers.
Functions ¶
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 ¶
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 ¶
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)