Interface BuildAgentConfiguration


  • public interface BuildAgentConfiguration
    Represents configuration of build agent (loaded from buildAgent.properties file)
    • Method Detail

      • getName

        java.lang.String getName()
        Returns name of the agent
        Returns:
        name of the agent
      • getOwnPort

        int getOwnPort()
        Returns port where agent accepts commands from the server
        Returns:
        see above
      • getOwnAddress

        java.lang.String getOwnAddress()
        Returns IP address where agent accepts commands from the server
        Returns:
        see above
      • getServerUrl

        java.lang.String getServerUrl()
        Returns server URL
        Returns:
        server URL
      • getAuthorizationToken

        @NotNull
        java.lang.String getAuthorizationToken()
        Returns agent authorization token which should be used to authorize build agent
        Returns:
        agent authorization token which should be used to authorize build agent
      • getPingCode

        @NotNull
        java.lang.String getPingCode()
        Returns the code to be returned from the ping method
        Returns:
        see above
      • getWorkDirectory

        @NotNull
        java.io.File getWorkDirectory()
        Returns path to AGENT_INSTALL_DIR/work directory
        Returns:
        see above
      • getAgentTempDirectory

        @Deprecated
        @NotNull
        java.io.File getAgentTempDirectory()
        Returns path to a folder under getTempDirectory(). This folder is cleaned before build is started.
        Returns:
        file to agent's temp dir. All temp files of agent should be put under that folder
      • getAgentToolsDirectory

        @NotNull
        java.io.File getAgentToolsDirectory()
        Provides path to tools folder on build agent. Returned folder is an existing path on the disk.
        Returns:
        path to agent tools folder
        Since:
        6.5
      • getCacheDirectory

        @NotNull
        java.io.File getCacheDirectory​(@NotNull
                                       java.lang.String key)
        Returns path to a folder under agent's system directory by a key. It is guaranteed the folder exists. Use this folder to store some persistent data on the agent. Note: No cleaning is performed by the agent!
        Parameters:
        key - plugin unique key
        Returns:
        path to a directory
        Since:
        5.0
      • getSystemDirectory

        @NotNull
        java.io.File getSystemDirectory()
        Returns path to a folder containing all system caches.
        Returns:
        see above
        Since:
        8.1.1
      • getTempDirectory

        @NotNull
        java.io.File getTempDirectory()
        Returns path to temp directory: parent folder of agent temp directory and build temp directory By default it returns INSTALL_DIR/temp, but that may be changes in buildAgent.properties file.
        Returns:
        see above
      • getAgentLibDirectory

        @NotNull
        java.io.File getAgentLibDirectory()
        Returns:
        returns path to agent's lib dir
      • getAgentPluginsDirectory

        @NotNull
        java.io.File getAgentPluginsDirectory()
        Returns:
        path to agent's plugins dir
      • getAgentUpdateDirectory

        @NotNull
        java.io.File getAgentUpdateDirectory()
        Returns:
        path to agent's update dir
      • getAgentHomeDirectory

        @NotNull
        java.io.File getAgentHomeDirectory()
        Returns:
        path to agent home
      • getAgentLogsDirectory

        @NotNull
        java.io.File getAgentLogsDirectory()
        Returns directory containing agent log files
        Returns:
        directory containing agent log files
      • getSystemInfo

        @NotNull
        BuildAgentSystemInfo getSystemInfo()
        Returns agent jvm(system) information
        Returns:
        agent jvm(system) information
      • getServerConnectionTimeout

        int getServerConnectionTimeout()
        Returns connection timeout in seconds. This timeout should be specified to all HTTP connections to the server.
        Returns:
        see above.
      • addAlternativeAgentAddress

        void addAlternativeAgentAddress​(@NotNull
                                        java.lang.String address)
        Adds alternative agent address that may be used by the server to communicate with agent.
        Parameters:
        address - ip address
        Since:
        5.1
      • getCustomProperties

        @NotNull
        @Deprecated
        java.util.Map<java.lang.String,​java.lang.String> getCustomProperties()
        Returns map of custom properties (defined in buildAgent.properties file and added by extensions). The property names are normally prefixed with env. and system.
        Returns:
        map of custom properties
      • addSystemProperty

        void addSystemProperty​(@NotNull
                               java.lang.String key,
                               @NotNull
                               java.lang.String value)
        Adds all-builds wide system property.

        Creates build parameters with Constants.SYSTEM_PREFIX prefix

        Modifications will be available for all builds on this agent

        Parameters:
        key - property name (without the "system." prefix)
        value - property value
        Since:
        6.0
      • addEnvironmentVariable

        void addEnvironmentVariable​(@NotNull
                                    java.lang.String key,
                                    @NotNull
                                    java.lang.String value)
        Adds all-builds wide environment variable. Creates build parameters with Constants.ENV_PREFIX prefix

        Note, on Windows machines environment size can be limited.

        Modifications will be available for all builds on this agent

        Parameters:
        key - name (without the "env." prefix), may be case sensitive or not depending on OS
        value - value
        Since:
        6.0
      • addConfigurationParameter

        void addConfigurationParameter​(@NotNull
                                       java.lang.String key,
                                       @NotNull
                                       java.lang.String value)
        Adds all-builds wide configuration parameter. Modifications will be available for all builds on this agent
        Parameters:
        key - name
        value - value
        Since:
        6.0
      • removeConfigurationParameter

        boolean removeConfigurationParameter​(@NotNull
                                             java.lang.String key)
        Remove build agent configuration parameter added via @code(addConfigurationParameter) method. Will not remove parameter specified in buildAgent.properties file.
        Parameters:
        key - name
        Returns:
        true if parameter was actually deleted, false otherwise (e.g parameter doesn't exist or is specified in buildAgent.properties file)
        Since:
        2017.1
      • getBuildParameters

        @NotNull
        BuildParametersMap getBuildParameters()
        Returns build parameters. Some of values may not be fully resolved.
        Returns:
        build-wide build parameters
        Since:
        6.0
      • getConfigurationParameters

        @NotNull
        java.util.Map<java.lang.String,​java.lang.String> getConfigurationParameters()
        Returns configuration parameters of this build
        Returns:
        unmodifiable configuration parameters map
        Since:
        6.0
      • getParametersResolver

        @NotNull
        ValueResolver getParametersResolver()
        Creates value resolver for parameters resolution in strings. The resolution rules are the same as for build parameters
        Returns:
        value resolver to perform resolution of all parameters references within string
        Since:
        6.0