Class VersionNumberBuilder
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<BuildWrapper>
-
- hudson.tasks.BuildWrapper
-
- org.jvnet.hudson.tools.versionnumber.VersionNumberBuilder
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<BuildWrapper>
public class VersionNumberBuilder extends BuildWrapper
SampleBuilder
.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 Classes Modifier and Type Class Description static class
VersionNumberBuilder.DescriptorImpl
Descriptor forVersionNumberBuilder
.-
Nested classes/interfaces inherited from class hudson.tasks.BuildWrapper
BuildWrapper.Environment
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static VersionNumberBuilder.DescriptorImpl
DESCRIPTOR
-
Constructor Summary
Constructors Constructor Description VersionNumberBuilder(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBuildsAllTime()
String
getBuildsThisMonth()
String
getBuildsThisWeek()
String
getBuildsThisYear()
String
getBuildsToday()
BuildWrapperDescriptor
getDescriptor()
String
getEnvironmentPrefixVariable()
String
getEnvironmentVariableName()
String
getProjectStartDate()
boolean
getUseAsBuildDisplayName()
String
getVersionNumberString()
We'll use this from theconfig.jelly
.Result
getWorstResultForIncrement()
BuildWrapper.Environment
setUp(AbstractBuild build, Launcher launcher, BuildListener listener)
-
Methods inherited from class hudson.tasks.BuildWrapper
all, decorateLauncher, decorateLogger, getProjectAction, getProjectActions, makeBuildVariables, makeSensitiveBuildVariables, preCheckout, setUp
-
-
-
-
Field Detail
-
DESCRIPTOR
@Extension public static final VersionNumberBuilder.DescriptorImpl DESCRIPTOR
-
-
Constructor Detail
-
VersionNumberBuilder
public VersionNumberBuilder(String versionNumberString, String projectStartDate, String environmentVariableName, String environmentPrefixVariable, String buildsToday, String buildsThisWeek, String buildsThisMonth, String buildsThisYear, String buildsAllTime, boolean skipFailedBuilds)
-
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 Detail
-
getBuildsToday
public String getBuildsToday()
-
getBuildsThisWeek
public String getBuildsThisWeek()
-
getBuildsThisMonth
public String getBuildsThisMonth()
-
getBuildsThisYear
public String getBuildsThisYear()
-
getBuildsAllTime
public String getBuildsAllTime()
-
getWorstResultForIncrement
public Result getWorstResultForIncrement()
-
getUseAsBuildDisplayName
public boolean getUseAsBuildDisplayName()
-
getVersionNumberString
public String getVersionNumberString()
We'll use this from theconfig.jelly
.
-
getProjectStartDate
public String getProjectStartDate()
-
getEnvironmentVariableName
public String getEnvironmentVariableName()
-
getEnvironmentPrefixVariable
public String getEnvironmentPrefixVariable()
-
setUp
public BuildWrapper.Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener)
- Overrides:
setUp
in classBuildWrapper
-
getDescriptor
public BuildWrapperDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<BuildWrapper>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<BuildWrapper>
-
-