Package io.reliza.plugins.reliza
Class RelizaBuilder
java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Builder
io.reliza.plugins.reliza.RelizaBuilder
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
,SimpleBuildStep
Uses the addRelease method from reliza library within the reliza wrapper to send release details to reliza hub.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Nested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory
-
Field Summary
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
perform
(Run<?, ?> run, FilePath workspace, EnvVars envVars, Launcher launcher, TaskListener listener) Extracts project details from environment variables to send release metadata to reliza hub.static String
resolveEnvVar
(String envVar, String suffix, EnvVars envVars) Obtains env variable with envSuffix if it exists, otherwise obtains env variable without envSuffix.void
Optional parameter for builder initialization.void
setArtType
(String artType) Optional parameter for builder initialization.void
setEnvSuffix
(String envSuffix) Sets up optional parameters from buildwrapper initialization.void
setProjectId
(String projectId) Optional parameter for builder initialization.void
Optional parameter for builder initialization.void
Optional parameter for builder initialization.void
setUseCommitList
(String useCommitList) Sets up optional parameters from buildwrapper initialization.void
setVersion
(String version) Optional parameter for builder initialization.static UUID
toUUID
(String projectId, TaskListener listener) String to UUID converter which handles conversion errors.Methods inherited from class hudson.tasks.Builder
all, getDescriptor, getRequiredMonitorService, prebuild
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuild
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, getRequiredMonitorService, perform, prebuild
Methods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
Constructor Details
-
RelizaBuilder
@DataBoundConstructor public RelizaBuilder()Builder initialization with no required parameters.
-
-
Method Details
-
setStatus
Optional parameter for builder initialization.- Parameters:
status
- - Used to override given status if needed.
-
setArtId
Optional parameter for builder initialization.- Parameters:
artId
- - Id of created artifact, required only if building an artifact.
-
setArtType
Optional parameter for builder initialization.- Parameters:
artType
- - Type of created artifact.
-
setVersion
Optional parameter for builder initialization.- Parameters:
version
- - Custom version of release to create, required if not using withReliza wrapper.
-
setProjectId
Optional parameter for builder initialization.- Parameters:
projectId
- - UUID of project, only used when supplying custom version.
-
setUri
Optional parameter for builder initialization.- Parameters:
uri
- - Base uri of api call, only used when supplying custom version. Default set to "https://app.relizahub.com".
-
setUseCommitList
Sets up optional parameters from buildwrapper initialization.- Parameters:
useCommitList
- - Flag which allows commit information from commit list to be prioritized over other commit parameters
-
setEnvSuffix
Sets up optional parameters from buildwrapper initialization.- Parameters:
envSuffix
- - Flag which adds a suffix to all environment variables to differentiate from other withReliza calls.
-
perform
public void perform(Run<?, ?> run, FilePath workspace, EnvVars envVars, Launcher launcher, TaskListener listener) throws InterruptedException, IOExceptionExtracts project details from environment variables to send release metadata to reliza hub.- Specified by:
perform
in interfaceSimpleBuildStep
- Throws:
InterruptedException
IOException
-
toUUID
String to UUID converter which handles conversion errors.- Parameters:
projectId
- - Project UUID.listener
- - TaskListener to log specific error.- Returns:
- Corresponding UUID if conversion succeeded and null otherwise.
-
resolveEnvVar
Obtains env variable with envSuffix if it exists, otherwise obtains env variable without envSuffix. If neither exist null is passed through.- Parameters:
envVar
- - Key to resolve to a value using environment variablessuffix
- - Search for environment variables with this suffixenvVars
- - Map of all environment variables to search through- Returns:
- Corresponding value from environment variable map
-