Interface AgentRunningBuild

    • Method Detail

      • getCheckoutDirectory

        @NotNull
        File getCheckoutDirectory()
        Returns checkout directory: directory where checkout is performed
        Returns:
        see above
      • getWorkingDirectory

        @NotNull
        @Deprecated
        File getWorkingDirectory()
        Deprecated.
        use BuildRunnerContext.getWorkingDirectory() this method returns working directory of first build runner.
        Returns build working directory: working directory where build runner started
        Returns:
        see above
      • getArtifactsPaths

        @Nullable
        String getArtifactsPaths()
        Returns artifacts paths specified for build. This value is always resolved in runtime
        Returns:
        artifacts paths
      • getFailBuildOnExitCode

        boolean getFailBuildOnExitCode()
        Property is defined by build configuration settings to define the way build runner should process build process exit code.
        Returns:
        true if build runner is expected to fail build if build process returned non-zero exit code
      • getBuildNumber

        @NotNull
        String getBuildNumber()
        Returns current build number. Note that during the build, build number may change (i.e. build script can emit ##teamcity[buildNumber ''] service message. Because of this, it is safer to read build number before build is finished (when build process is not working anymore).
        Returns:
        current build number
        Since:
        5.1.1
      • getSharedParametersResolver

        @NotNull
        ValueResolver getSharedParametersResolver()
        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
      • getBuildFeatures

        @NotNull
        Collection<AgentBuildFeature> getBuildFeatures()
        Returns:
        collection of enabled build features for the build
        Since:
        7.0
      • getBuildFeaturesOfType

        @NotNull
        Collection<AgentBuildFeature> getBuildFeaturesOfType​(@NotNull
                                                             String type)
        Parameters:
        type - type to filter features
        Returns:
        collection of enabled build features for the build
        Since:
        7.0
      • getInterruptReason

        @Nullable
        BuildInterruptReason getInterruptReason()
        Use this method to check if build is interrupted.
        Returns:
        current build interrupt reason or null if build is not interrupted
        Since:
        7.1
      • interruptBuild

        void interruptBuild​(@NotNull
                            String comment,
                            boolean reQueue)
        Interrupt and cancel running build.
        Parameters:
        comment - will be used as a canceling comment for the build
        reQueue - if true, build should be re-queued on the server side
        Since:
        2019.1
      • isBuildFailingOnServer

        boolean isBuildFailingOnServer()
                                throws InterruptedException
        Make synchronous call to the build server and check if the build is failing there
        Returns:
        true if the build is failing on server
        Throws:
        InterruptedException - if the request cannot be completed (for instance, the build is no longer present on the server)
        Since:
        8.0
      • getPasswordReplacer

        @NotNull
        PasswordReplacer getPasswordReplacer()
        Returns:
        instance of PasswordReplacer which can be used to replace passwords known to current build in different logs or files
        Since:
        2017.1
      • getArtifactStorageSettings

        @NotNull
        Map<String,​String> getArtifactStorageSettings()
        Returns:
        artifact storage settings if there are any available for this build
        Since:
        2017.1
      • getNodeIdHolder

        @NotNull
        NodeIdHolder getNodeIdHolder()
        Returns:
        information about the current node id associated with this build, can be used to set a proper NodeId cookie to HTTP requests to TeamCity server to ensure the request is landed on a specified node
        Since:
        2022.06