Package be.vbgn.gradle.cidetect
Interface CiInformation
-
- All Known Implementing Classes:
AppveyorInformation
public interface CiInformation
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static CiInformationdetect()Detects if the build is running in a CI environmentstatic CiInformationdetect(org.gradle.api.Project project)Detects if the build is running in a CI environmentjava.lang.StringgetBranch()java.lang.StringgetBuildNumber()default java.lang.StringgetPlatform()java.lang.StringgetPullRequest()java.lang.StringgetPullRequestTargetBranch()default java.lang.StringgetReference()java.lang.StringgetTag()booleanisCi()default booleanisPullRequest()default booleanisTag()
-
-
-
Method Detail
-
detect
@Nonnull static CiInformation detect()
Detects if the build is running in a CI environment- Returns:
- Build information from the CI platform
-
detect
@Nonnull static CiInformation detect(@Nullable org.gradle.api.Project project)
Detects if the build is running in a CI environment- Parameters:
project- The gradle project that is checked. May be null if no project is available.- Returns:
- Build information from the CI platform
-
isCi
boolean isCi()
- Returns:
- If the build is running in a CI environment
-
getBuildNumber
@Nullable java.lang.String getBuildNumber()
- Returns:
- A unique identifier of the build. Usually a sequential buildnumber, but can be anything depending on the CI environment
-
getBranch
@Nullable java.lang.String getBranch()
- Returns:
- The current branch for which a build is being executed
-
getReference
@Nullable default java.lang.String getReference()
- Returns:
- The SCM reference that is currently being built. Either a tag or a branch, depending on what is being built
-
isPullRequest
default boolean isPullRequest()
- Returns:
- If the current build is a pull request
-
getPullRequest
@Nullable java.lang.String getPullRequest()
- Returns:
- A unique identifier of the pull request. Usually a sequential number, but can be anything depending on the SCM platform
-
getPullRequestTargetBranch
@Nullable java.lang.String getPullRequestTargetBranch()
- Returns:
- The branch where the pull request will be merged into if it is merged
-
isTag
default boolean isTag()
- Returns:
- If the current build is a build of a tag
-
getTag
@Nullable java.lang.String getTag()
- Returns:
- The current tag for which a build is being executed
-
getPlatform
@Nullable default java.lang.String getPlatform()
- Returns:
- A string that identifies the CI platform that the build is being run on
-
-