Documentation ¶
Index ¶
- Constants
- Variables
- func FlatOut(message string, a ...interface{})
- func GOut(group string, message string, a ...interface{})
- func GetFileLastTouched(info os.FileInfo) (lastTouched time.Time)
- func Hostname() (name string, err error)
- func Out(message string, a ...interface{})
- func PrintAllStackTraces()
- type AnyConfigAcceptor
- type AtomicBoolean
- type AtomicInt32
- type CleanupSettings
- type ClientOptions
- type Config
- type ConfigVerifier
- type ConsoleMonitor
- type JavaOptions
- type JenkinsConnection
- func (self *JenkinsConnection) CIClient() *http.Client
- func (self *JenkinsConnection) CIGet(path string) (response *http.Response, err error)
- func (self *JenkinsConnection) CIRequest(method, path string, body io.Reader) (request *http.Request, err error)
- func (self *JenkinsConnection) HasCIConnection() bool
- type Maintenance
- type SSHServer
Constants ¶
const (
ClientOptionsDescription = `` /* 1572-byte string literal not displayed */
)
const (
ConfigDescription = `
Configuration file for Jenkins Client Launcher (JCL)
`
)
const (
JavaOptionsDescription = `` /* 747-byte string literal not displayed */
)
const (
JenkinsConnectionDescription = `` /* 834-byte string literal not displayed */
)
const (
MaintenanceDescription = `` /* 1561-byte string literal not displayed */
)
const (
SSHServerDescription = `
<sshServer>
Configures the server port of the SSH server (only for run mode 'ssh-server')
</sshServer>
`
)
Variables ¶
var ClientJar = ""
Points to the absolute path of the Jenkins client jar.
var Java = ""
Points to the absolute path of the Java executable.
var JavaArgs = []string{}
Contains additional java args that are added before the configured java args.
var JnlpArgs = make(map[string]string)
Contains additional arguments that must be injected into the JNLP config file that is downloaded from Jenkins.
var NodeIsIdle = NewAtomicBoolean()
Is updated by the server monitor with the current node state (IDLE means no build is running). Note: When server side monitoring is disable the node will ALWAYS appear as idle.
var OutputMutex = &sync.Mutex{}
Functions ¶
func FlatOut ¶
func FlatOut(message string, a ...interface{})
Prints a message to the app's console output with optional Printf styled substitutions and without a JCL prefix.
func GOut ¶
Prints a message to the app's console output with optional Printf styled substitutions. "group" is used to group messages of the same kind.
Types ¶
type AnyConfigAcceptor ¶
type AnyConfigAcceptor struct { }
Helper to use by types that accept any config but require an implementation of ConfigVerifier.
func (*AnyConfigAcceptor) IsConfigAcceptable ¶
func (_ *AnyConfigAcceptor) IsConfigAcceptable(config *Config) bool
type AtomicBoolean ¶
type AtomicBoolean struct {
// contains filtered or unexported fields
}
Thread save boolean value.
func NewAtomicBoolean ¶
func NewAtomicBoolean() *AtomicBoolean
func (*AtomicBoolean) Get ¶
func (self *AtomicBoolean) Get() bool
func (*AtomicBoolean) Set ¶
func (self *AtomicBoolean) Set(value bool)
type AtomicInt32 ¶
type AtomicInt32 struct {
// contains filtered or unexported fields
}
Thread save boolean value.
func NewAtomicInt32 ¶
func NewAtomicInt32() *AtomicInt32
func (*AtomicInt32) AddAndGet ¶
func (self *AtomicInt32) AddAndGet(delta int32) int32
func (*AtomicInt32) Get ¶
func (self *AtomicInt32) Get() int32
func (*AtomicInt32) Set ¶
func (self *AtomicInt32) Set(value int32)
type CleanupSettings ¶
type ClientOptions ¶
type ClientOptions struct { ClientName string `xml:"client>name"` SecretKey string `xml:"client>secretKey"` PassCIAuth bool `xml:"client>passAuth"` CreateClientIfMissing bool `xml:"client>createIfMissing"` ClientMonitorStateOnServer bool `xml:"client>monitoring>stateOnServer>enabled"` ClientMonitorStateOnServerMaxFailures int16 `xml:"client>monitoring>stateOnServer>maxFailures"` ClientMonitorConsole bool `xml:"client>monitoring>console>enabled"` HandleReconnectsInLauncher bool `xml:"client>restart>handleReconnects"` SleepTimeSecondsBetweenFailures int64 `xml:"client>restart>sleepOnFailure>seconds"` PeriodicClientRestartEnabled bool `xml:"client>restart>periodic>enabled"` PeriodicClientRestartOnlyWhenIDLE bool `xml:"client>restart>periodic>onlyWhenIdle"` PeriodicClientRestartIntervalHours int64 `xml:"client>restart>periodic>interval>hours"` OutOfMemoryRestartEnabled bool `xml:"client>restart>outOfMemory>enabled"` OutOfMemoryRestartOnlyWhenIDLE bool `xml:"client>restart>outOfMemory>onlyWhenIdle"` }
type Config ¶
type Config struct { XMLName xml.Name `xml:"config"` RunMode string `xml:"runMode,attr"` Autostart bool `xml:"autostart,attr"` ConfigDescription string `xml:",comment"` NeedsSave bool `xml:"-"` JenkinsConnection ClientOptions JavaOptions SSHServer ConsoleMonitor Maintenance }
func NewConfig ¶
Returns a new instance that is initialized from the specified file. If the file cannot be loaded the returned config will be similar to what NewDefaultConfig() returns.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
Returns a new instance of config with default values.
type ConfigVerifier ¶
type ConfigVerifier interface { // Returns true if the configuration is acceptable, false otherwise. IsConfigAcceptable(config *Config) bool }
Implemented by types that verify if the configuration is valid for them.
type ConsoleMonitor ¶
type ConsoleMonitor struct {
RestartTriggerTokens []string `xml:"console>errorTokens>token"`
}
Allows to configure console monitoring.
func (*ConsoleMonitor) IsRestartTriggered ¶
func (self *ConsoleMonitor) IsRestartTriggered(line string) bool
Returns true if the given line contains a restart trigger token.
type JavaOptions ¶
type JavaOptions struct { JavaArgs []string `xml:"java>args>arg"` JavaMaxMemory string `xml:"java>maxMemory"` ForceFullGC bool `xml:"java>forceFullGC>enabled"` ForceFullGCIntervalMinutes int64 `xml:"java>forceFullGC>interval>minutes"` ForceFullGCIDLEIntervalMinutes int64 `xml:"java>forceFullGC>idleInterval>minutes"` }
type JenkinsConnection ¶
type JenkinsConnection struct { CIHostURI string `xml:"ci>url"` CIAcceptAnyCert bool `xml:"ci>noCertificateCheck"` CIUsername string `xml:"ci>auth>user"` CIPassword string `xml:"ci>auth>password"` CITunnelSSHEnabled bool `xml:"ci>tunnel>jnlp>ssh>enabled"` CITunnelSSHAddress string `xml:"ci>tunnel>jnlp>ssh>address"` CITunnelSSHPort uint16 `xml:"ci>tunnel>jnlp>ssh>port"` CITunnelSSHFingerprint string `xml:"ci>tunnel>jnlp>ssh>fingerprint"` CITunnelSSHUsername string `xml:"ci>tunnel>jnlp>ssh>auth>user"` CITunnelSSHPassword string `xml:"ci>tunnel>jnlp>ssh>auth>password"` // contains filtered or unexported fields }
func (*JenkinsConnection) CIClient ¶
func (self *JenkinsConnection) CIClient() *http.Client
Returns a HTTP client that is configured to connect with Jenkins.
func (*JenkinsConnection) CIGet ¶
func (self *JenkinsConnection) CIGet(path string) (response *http.Response, err error)
Issues a HTTP-GET request on Jenkins using the specified request path (= path + query string).
func (*JenkinsConnection) CIRequest ¶
func (self *JenkinsConnection) CIRequest(method, path string, body io.Reader) (request *http.Request, err error)
Returns a request object which may be used with CIClient to do a HTTP request.
func (*JenkinsConnection) HasCIConnection ¶
func (self *JenkinsConnection) HasCIConnection() bool
Returns true if the configuration has a Jenkins url.
type Maintenance ¶
type Maintenance struct {
CleanupSettingsList []CleanupSettings `xml:"maintenance>cleanup"`
}