Interface CiState


@Immutable
public interface CiState
Contains state about the current build on a CI if it is running on CI.
  • Method Summary

    Modifier and Type Method Description
    static CiState createAndAdd​(org.gradle.api.Project project)  
    java.lang.String getBranch()
    Returns the branch for this build if it is on CI or empty otherwise.
    java.lang.String getRevisionId()
    Returns the revision ID for this build (e.g., git commit) if it is on CI, or empty otherwise.
    java.util.List<java.lang.String> getRevisionTags()
    Returns tags to associate with this build, usually used when tagging docker images for deployment.
    boolean isCi()
    Returns whether this build is happening on CI or mimics the behavior of CI.
    boolean isLocalBuild()
    Returns whether this is a local build on a developer's machine.
    boolean isMasterBuild()
    Returns whether this is a master build on CI.
    boolean isReleaseBuild()
    Returns whether this is a release build on CI.
  • Method Details

    • createAndAdd

      static CiState createAndAdd​(org.gradle.api.Project project)
    • isCi

      boolean isCi()
      Returns whether this build is happening on CI or mimics the behavior of CI.
    • isMasterBuild

      boolean isMasterBuild()
      Returns whether this is a master build on CI.
    • isReleaseBuild

      boolean isReleaseBuild()
      Returns whether this is a release build on CI.
    • isLocalBuild

      boolean isLocalBuild()
      Returns whether this is a local build on a developer's machine. This is true even if it is mimicing the behavior of CI locally.
    • getRevisionId

      java.lang.String getRevisionId()
      Returns the revision ID for this build (e.g., git commit) if it is on CI, or empty otherwise.
    • getBranch

      java.lang.String getBranch()
      Returns the branch for this build if it is on CI or empty otherwise.
    • getRevisionTags

      java.util.List<java.lang.String> getRevisionTags()
      Returns tags to associate with this build, usually used when tagging docker images for deployment.