Class EnvironmentUtils
java.lang.Object
org.cyclonedx.gradle.utils.EnvironmentUtils
Utility class for working with environment variables in common CI environments.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable StringGet the URI of the current build from the environment variables set on common build systems like GitHub Actions, GitLab CI, etc.static @Nullable StringgetBuildURI(String str) Get the URI of the current build from the specified environment variable.
-
Constructor Details
-
EnvironmentUtils
public EnvironmentUtils()
-
-
Method Details
-
getBuildURI
Get the URI of the current build from the environment variables set on common build systems like GitHub Actions, GitLab CI, etc.- Returns:
- the URI of the current build or null if it cannot be determined
-
getBuildURI
Get the URI of the current build from the specified environment variable. Additionally, a pattern can be provided to extract the URI from the environment variable. An example pattern could be "${SERVER}/jobs/${JOB_ID}".- Parameters:
str- the name of the environment variable or pattern to use- Returns:
- the URI of the current build or null if it cannot be determined
-