Class VersionNumberBuilder
- All Implemented Interfaces:
ExtensionPoint
,Describable<BuildWrapper>
Builder
.
This build wrapper makes an environment variable with a version number available to the build. For more information on how the format stream works, see the Version Number Plugin wiki page.
This plugin keeps track of its version through a VersionNumberAction
attached
to the project. Each build that uses this plugin has its own VersionNumberAction,
and this contains the builds today / this week / this month / this year / all time.
When incrementing each of these values, unless they're overridden in the configuration
the value from the previous build will be used.
Such a value can be either overridden with a plain number or with an environment-variable. In the later case the value will be read from the environment-variable at build-time. If it cannot be parsed as an integer the value from the previous build will be incremented and used instead.
- Author:
- Carl Lischeske - NETFLIX, Deniz Bahadir - BENOCS
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.tasks.BuildWrapper
BuildWrapper.Environment
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVersionNumberBuilder
(String versionNumberString, String projectStartDate, String environmentVariableName, String environmentPrefixVariable, String buildsToday, String buildsThisWeek, String buildsThisMonth, String buildsThisYear, String buildsAllTime, boolean skipFailedBuilds) VersionNumberBuilder
(String versionNumberString, String projectStartDate, String environmentVariableName, String environmentPrefixVariable, String buildsToday, String buildsThisWeek, String buildsThisMonth, String buildsThisYear, String buildsAllTime, boolean skipFailedBuilds, boolean useAsBuildDisplayName) VersionNumberBuilder
(String versionNumberString, String projectStartDate, String environmentVariableName, String environmentPrefixVariable, String buildsToday, String buildsThisWeek, String buildsThisMonth, String buildsThisYear, String buildsAllTime, String worstResultForIncrement, boolean useAsBuildDisplayName) -
Method Summary
Modifier and TypeMethodDescriptionboolean
We'll use this from theconfig.jelly
.setUp
(AbstractBuild build, Launcher launcher, BuildListener listener) Methods inherited from class hudson.tasks.BuildWrapper
all, decorateLauncher, decorateLogger, getProjectAction, getProjectActions, makeBuildVariables, makeSensitiveBuildVariables, preCheckout, setUp
-
Field Details
-
DESCRIPTOR
-
-
Constructor Details
-
VersionNumberBuilder
-
VersionNumberBuilder
public VersionNumberBuilder(String versionNumberString, String projectStartDate, String environmentVariableName, String environmentPrefixVariable, String buildsToday, String buildsThisWeek, String buildsThisMonth, String buildsThisYear, String buildsAllTime, boolean skipFailedBuilds, boolean useAsBuildDisplayName) -
VersionNumberBuilder
@DataBoundConstructor public VersionNumberBuilder(String versionNumberString, String projectStartDate, String environmentVariableName, String environmentPrefixVariable, String buildsToday, String buildsThisWeek, String buildsThisMonth, String buildsThisYear, String buildsAllTime, String worstResultForIncrement, boolean useAsBuildDisplayName)
-
-
Method Details
-
getBuildsToday
-
getBuildsThisWeek
-
getBuildsThisMonth
-
getBuildsThisYear
-
getBuildsAllTime
-
getWorstResultForIncrement
-
getUseAsBuildDisplayName
public boolean getUseAsBuildDisplayName() -
getVersionNumberString
We'll use this from theconfig.jelly
. -
getProjectStartDate
-
getEnvironmentVariableName
-
getEnvironmentPrefixVariable
-
setUp
public BuildWrapper.Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) - Overrides:
setUp
in classBuildWrapper
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<BuildWrapper>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<BuildWrapper>
-