Class VersionNumberCommon
java.lang.Object
org.jvnet.hudson.tools.versionnumber.VersionNumberCommon
Common methods used by freestyle and pipeline jobs.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatVersionNumber(String versionNumberFormatString, Date projectStartDate, VersionNumberBuildInfo info, Map<String, String> enVars, Calendar buildDate) static RungetPreviousBuildWithVersionNumber(Run build, String envPrefix) static VersionNumberBuildInfoincBuild(Run build, EnvVars vars, Run prevBuild, Result worstResultForIncrement, String overrideBuildsToday, String overrideBuildsThisWeek, String overrideBuildsThisMonth, String overrideBuildsThisYear, String overrideBuildsAllTime) static StringChecks if the given string contains a valid value and returns that value again if it is valid or returns an empty string if it is not.static Date
-
Field Details
-
DEFAULT_DATE_FORMAT_PATTERN
- See Also:
-
WORST_RESULT_SUCCESS
- See Also:
-
WORST_RESULT_UNSTABLE
- See Also:
-
WORST_RESULT_FAILURE
- See Also:
-
WORST_RESULT_ABORTED
- See Also:
-
WORST_RESULT_NOT_BUILT
- See Also:
-
ENV_VAR_PATTERN
- See Also:
-
-
Constructor Details
-
VersionNumberCommon
public VersionNumberCommon()
-
-
Method Details
-
incBuild
-
getPreviousBuildWithVersionNumber
-
parseDate
-
formatVersionNumber
-
makeValid
Checks if the given string contains a valid value and returns that value again if it is valid or returns an empty string if it is not. A valid value encoded in the string must either be a (positive) number, convertible to an integer or a reference to an environment-variable in the form${VARIABLE_NAME}or$VARIABLE_NAME.- Parameters:
value- The (user-provided) string which should either contain a number or a reference to an environment-variable.- Returns:
- The given buildNum if valid or an empty string.
-