Requirement

data class Requirement(    val type: RequirementType,     val param: String,     val value: String? = null,     val id: String? = null)

An agent requirement, use methods in Requirements class to create it

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

Parameters

type

requirement type

param

parameter name

value

value to check, might be null if requirement doesn't need a value

id

optional requirement id, if not specified will be generated

Constructors

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

Functions

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val id: String? = null
Link copied to clipboard
val param: String
Link copied to clipboard
val type: RequirementType
Link copied to clipboard
val value: String? = null