Class RelizaBuilder

All Implemented Interfaces:
ExtensionPoint, Describable<Builder>, BuildStep, SimpleBuildStep

public class RelizaBuilder
extends Builder
implements SimpleBuildStep
Uses the addRelease method from reliza library within the reliza wrapper to send release details to reliza hub.
  • Constructor Details

    • RelizaBuilder

      @DataBoundConstructor public RelizaBuilder()
      Builder initialization with no required parameters.
  • Method Details

    • setStatus

      @DataBoundSetter public void setStatus​(String status)
      Optional parameter for builder initialization.
      Parameters:
      status - - Used to override given status if needed.
    • setArtId

      @DataBoundSetter public void setArtId​(String artId)
      Optional parameter for builder initialization.
      Parameters:
      artId - - Id of created artifact, required only if building an artifact.
    • setArtType

      @DataBoundSetter public void setArtType​(String artType)
      Optional parameter for builder initialization.
      Parameters:
      artType - - Type of created artifact.
    • setVersion

      @DataBoundSetter public void setVersion​(String version)
      Optional parameter for builder initialization.
      Parameters:
      version - - Custom version of release to create, required if not using withReliza wrapper.
    • setProjectId

      @DataBoundSetter public void setProjectId​(String projectId)
      Optional parameter for builder initialization.
      Parameters:
      projectId - - UUID of project, only used when supplying custom version.
    • setUri

      @DataBoundSetter public void setUri​(String uri)
      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

      @DataBoundSetter public void setUseCommitList​(String useCommitList)
      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

      @DataBoundSetter public void setEnvSuffix​(String envSuffix)
      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, IOException
      Extracts project details from environment variables to send release metadata to reliza hub.
      Specified by:
      perform in interface SimpleBuildStep
      Throws:
      InterruptedException
      IOException
    • toUUID

      public static UUID toUUID​(String projectId, TaskListener listener)
      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

      public static String resolveEnvVar​(String envVar, String suffix, EnvVars envVars)
      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 variables
      suffix - - Search for environment variables with this suffix
      envVars - - Map of all environment variables to search through
      Returns:
      Corresponding value from environment variable map