Interface BuildAgentConfiguration

    • Method Detail

      • getName

        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

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

        String getServerUrl()
        Returns server URL
        Returns:
        server URL
      • getAuthorizationToken

        @NotNull
        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
        String getPingCode()
        Returns the code to be returned from the ping method
        Returns:
        see above
      • getWorkDirectory

        @NotNull
        File getWorkDirectory()
        Returns path to AGENT_INSTALL_DIR/work directory
        Returns:
        see above
      • getAgentToolsDirectory

        @NotNull
        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
        File getCacheDirectory​(@NotNull
                               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
        File getSystemDirectory()
        Returns path to a folder containing all system caches.
        Returns:
        see above
        Since:
        8.1.1
      • getTempDirectory

        @NotNull
        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
        File getAgentLibDirectory()
        Returns:
        returns path to agent's lib dir
      • getAgentPluginsDirectory

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

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

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

        @NotNull
        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
                                        String address)
        Adds alternative agent address that may be used by the server to communicate with agent.
        Parameters:
        address - ip address
        Since:
        5.1
      • addSystemProperty

        void addSystemProperty​(@NotNull
                               String key,
                               @NotNull
                               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
                                    String key,
                                    @NotNull
                                    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
                                       String key,
                                       @NotNull
                                       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
                                             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
        Map<String,​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