Requirements

open class Requirements

Collection of agent requirements in build configuration or template.

Example. Requirements for different agent OSes

buildType {
    // ...
    requirements {
      contains("teamcity.agent.jvm.os.name", "Windows")
    }
}
requirements {
    contains("teamcity.agent.jvm.os.name", "Linux")
}
requirements {
    contains("teamcity.agent.jvm.os.name", "Mac OS X")
}

Example. Requirement for an agent with a running Docker server on Linux OS

requirements {
    exists("docker.server.version")
    contains("teamcity.agent.jvm.os.name", "Linux")
}

Example. Requirement for an agent with a specific parameter in its buildAgent.properties file

requirements {
    exists("my.custom.parameter")
}

See also requirements().

Constructors

Link copied to clipboard
fun Requirements()

Functions

Link copied to clipboard
fun contains(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter contains the given value

Link copied to clipboard
fun doesNotContain(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter does not contain the given value

Link copied to clipboard
fun doesNotEqual(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter is not equal to the given value

Link copied to clipboard
fun doesNotExist(param: String, id: String? = null)

Adds a requirement that the parameter with the specified name does not exist on the agent

Link copied to clipboard
fun doesNotMatch(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter does not match the given value

Link copied to clipboard
fun endsWith(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter ends with the given value

Link copied to clipboard
fun equals(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter is equal to the given value

Link copied to clipboard
fun exists(param: String, id: String? = null)

Adds a requirement that the parameter with the specified name exists on the agent

Link copied to clipboard
fun lessThan(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter is less than the given value

Link copied to clipboard
fun lessThanVer(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter is less than the given value as a version

Link copied to clipboard
fun matches(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter matches the given value

Link copied to clipboard
fun moreThan(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter is greater than the given value

Link copied to clipboard
fun moreThanVer(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter is greater than the given value as a version

Link copied to clipboard
fun noLessThan(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter is not less than the given value

Link copied to clipboard
fun noLessThanVer(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter is not less than the given value as a version

Link copied to clipboard
fun noMoreThan(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter is not greater than the given value

Link copied to clipboard
fun noMoreThanVer(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter is not greater than the given value as a version

Link copied to clipboard
fun requirement(r: Requirement)

Adds the specified requirement

Link copied to clipboard
fun startsWith(    param: String,     value: String,     id: String? = null)

Adds a requirement that the value of the specified parameter starts with the given value

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun Requirements.copy(): Requirements

Copies the receiver requirements

Link copied to clipboard
fun Requirements.copyTo(target: Requirements): Requirements

Copies the receiver requirements to the specified target