Class BuildDataHelper
java.lang.Object
org.jenkinsci.plugins.github.util.BuildDataHelper
Stores common methods for
BuildData
handling.- Since:
- 1.10
- Author:
- Oleg Nenashev
-
Method Summary
Modifier and TypeMethodDescriptionstatic hudson.plugins.git.util.BuildData
calculateBuildData
(String parentName, String parentFullName, List<hudson.plugins.git.util.BuildData> buildDataList) Calculate build data from downstream builds, that could be a shared library which is loaded first in a pipeline.static org.eclipse.jgit.lib.ObjectId
getCommitSHA1
(Run<?, ?> build) Gets SHA1 from the build.
-
Method Details
-
calculateBuildData
public static hudson.plugins.git.util.BuildData calculateBuildData(String parentName, String parentFullName, List<hudson.plugins.git.util.BuildData> buildDataList) Calculate build data from downstream builds, that could be a shared library which is loaded first in a pipeline. For that reason, this method compares all remote URLs for each build data, with the real project name, to determine the proper build data. This way, the SHA returned in the build data will relate to the project- Parameters:
parentName
- name of the parent buildparentFullName
- full name of the parent buildbuildDataList
- the list of build datas from a build run- Returns:
- the build data related to the project, null if not found
-
getCommitSHA1
@NonNull public static org.eclipse.jgit.lib.ObjectId getCommitSHA1(@NonNull Run<?, ?> build) throws IOExceptionGets SHA1 from the build.- Parameters:
build
-- Returns:
- SHA1 of the las
- Throws:
IOException
- Cannot get the info about commit ID
-