The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Inedo BuildMaster Plugin.

buildMasterCreatePackage: Create BuildMaster Package

Creates a new package for the selected BuildMaster application and sets the BUILDMASTER_PACKAGE_NUMBER script and environment variables.

Unlike the FreeStyle plugins, this script plugin can be used for both build and post build actions. The choice of executing this plugin as a build step or post build action will be largely dependent on how you import the build artifacts into BuildMaster:

  1. You are using the BuildMaster Jenkins Build Importer Build Step which imports build artifacts from Jenkins: the post build action is required.
  2. You are using a standard BuildMaster build step and importing files from a folder that you've placed the artifacts into from the Jenkins build (eg using ArtifactDeployer Plugin): either the post build or build step actions will be fine.
  3. You use an external artifact repository such as Nexus or Artifactory: either the post build or build step actions will be fine.

If you have multiple Jenkins jobs all triggering a build for the same BuildMaster application check out the "Enable Deployable in BuildMaster" and "Copy Previous Build's Variables" options as a means to ensure that the new BuildMaster build picks up artifacts from only the Jenkins jobs that have build for its release.

Note that pipeline steps are unable to set variables directly so must be called in this format:

BUILDMASTER_PACKAGE_NUMBER = buildMasterCreatePackage(applicationId: '${BUILDMASTER_APPLICATION_ID}', packageNumber: '${BUILDMASTER_PACKAGE_NUMBER}', releaseNumber: '${BUILDMASTER_RELEASE_NUMBER}', deployToFirstStage: true, waitTillBuildCompleted: [printLogOnFailure: true])
  • applicationId (optional)
    The Id of the BuildMaster application to trigger the build for. Defaults to the BUILDMASTER_APPLICATION variable populated by the "Select BuildMaster Application" action.
    • Type: String
  • deployToFirstStage (optional)
    Will trigger the deployment to the first stage, and any subsequent stages where the stage is configured to automatically deploy to the next stage.
    • Type: boolean
  • enableReleaseDeployable (optional)

    If the BuildMaster deployable that these artifacts are associated with are disabled by default for a release checking this option will enable the deployable for the release before triggering a build.

    This might be useful when you have multiple Jenkins jobs all triggering a build for the same BuildMaster application.

      Nested Object
    • deployableId

      The id of the deployable to ensure is enabled in BuildMaster for the selected release. Defaults to the BUILDMASTER_DEPLOYABLE_ID variable populated by the "Select BuildMaster Application" action.

      • Type: String
  • packageNumber (optional)

    The number that BuildMaster should use for the package. Defaults to the BUILDMASTER_PACKAGE_NUMBER variable populated by the "Select BuildMaster Application" action. Leave the field blank to have BuildMaster use it's own PackageNumber - the BUILDMASTER_PACKAGE_NUMBER will be set to the actual BuildMaster build number used in this instance.

    If supplying a build number to BuildMaster and the build will fail with a BadRequest exception if an attempt is made to reuse a build number from a previous build. If this happens you will need to update the Jenkins build number to something greater than the latest BuildMaster build - there is a plugin to help with that: Next Build Number Plugin.

    • Type: String
  • releaseNumber (optional)
    The BuildMaster release number to trigger the build for. Defaults to the BUILDMASTER_RELEASE_NUMBER variable populated by the "Select BuildMaster Application" action. The job will fail if there is no active BuildMaster release.
    • Type: String
  • setBuildVariables (optional)

    Presents options for passing variables to BuildMaster.

      Nested Object
    • preserveVariables

      If checked will gather the variables from the previous build and add them to the list of variables being passed in for this build, overriding any that are being set for this build.

      This might be useful when you have multiple Jenkins jobs all triggering a build for the same BuildMaster application.

      • Type: boolean
    • variables

      Provide a list of variables to pass to BuildMaster.

      • A variable must be in the format "variable=value"
      • Additional variables must be declared on separate lines
      • Lines starting with # are treated as comments
      • When using pipeline script and you want to pass several variables use one of these formats:
        • Separate variables using newline character. Generated script will resemble: variables: 'var1=one\nvar2=two'
        • Separate variables using multi-line string. Generated script will resemble: variables: '''var1=one
          var2=two'''
      • Type: String
  • waitTillBuildCompleted (optional)
    If checked waits until BuildMaster has completed building and returns the status - success or failure, otherwise exits as soon as successfully triggered BuildMaster build.
      Nested Object
    • printLogOnFailure
      If checked will print the BuildMaster log for the build execution to the Jenkins console if the build fails - but only if the "Wait Till Build Completed" option is also checked.
      • Type: boolean

buildMasterDeployPackageToStage: Deploy BuildMaster Package To Stage

Deploys (or re-deploys) a package to a particular stage.

Note that when used in a pipeline step that the applicationdId, releaseNumber, and packageNumber fields are required:

buildMasterDeployPackageToStage(applicationId: BUILDMASTER_APPLICATION_ID, releaseNumber: BUILDMASTER_RELEASE_NUMBER, packageNumber: BUILDMASTER_PACKAGE_NUMBER, waitTillBuildCompleted: [printLogOnFailure: true])
  • applicationId (optional)
    The BuildMaster Application Id to trigger the build for. If the field is empty then assumes the "Select BuildMaster Application" action has been used to provide the value and will look this up using the expression "${BUILDMASTER_APPLICATION_ID}".

    This setting would only be altered if not using the "Select BuildMaster Application" action.

    • Type: String
  • packageNumber (optional)
    The BuildMaster release number to trigger the build for. If the field is empty then assumes the "Select BuildMaster Application" action has been used to provide the value and will look this up using the expression "${BUILDMASTER_RELEASE_NUMBER}".

    The job will fail if there is no active BuildMaster release.

    This setting would only be altered if not using the "Select BuildMaster Application" action.

    • Type: String
  • releaseNumber (optional)
    The BuildMaster release number to trigger the build for. Defaults to the BUILDMASTER_RELEASE_NUMBER variable populated by the "Select BuildMaster Application" action. The job will fail if there is no active BuildMaster release.
    • Type: String
  • stage (optional)
    • Type: String
  • waitTillBuildCompleted (optional)
      Nested Object
    • printLogOnFailure
      If checked will print the BuildMaster log for the build execution to the Jenkins console if the build fails - but only if the "Wait Till Build Completed" option is also checked.
      • Type: boolean

buildMasterWithApplicationRelease: Select BuildMaster Application

Requests the Release Number for the selected BuildMaster application from BuildMaster and injects these environment variables into the build job:

  • BUILDMASTER_APPLICATION_ID
  • BUILDMASTER_RELEASE_NUMBER
  • BUILDMASTER_PACKAGE_NUMBER
  • BUILDMASTER_DEPLOYABLE_ID

Because the Release Number and build numbers could be required by several build and post-build actions selecting the application and setting up the environment variable has been separated from the trigger build action.

If you have multiple jobs all triggering builds on the same BuildMaster application this build step will queue those jobs so that you cannot get two jobs trigger a build at the same time.

  • applicationId
    Select the BuildMaster application to trigger build for. During a build the BUILDMASTER_APPLICATION_ID environment variable will be populated with the id of the selected application.
    • Type: String
  • deployableId (optional)

    Select the BuildMaster deployable associated with this job. If selected, during a build the BUILDMASTER_DEPLOYABLE_ID environment variable will be populated with the deployable's id.

    This is only required when using the trigger build action to enable a deployable.

    • Type: String
  • packageNumberSource (optional)

    Select which build number to use to populate the BUILDMASTER_PACKAGE_NUMBER environment variable:

    • Jenkins: use the Jenkins build number
    • BuildMaster: determine which build number BuildMaster will use next.
    • Not Required: don't care what build number BuildMaster uses and we'll each do our own thing - BUILDMASTER_PACKAGE_NUMBER will not be populated

    TIP: If have multiple Jenkins jobs triggering the one BuildMaster application build then use "Not Required", otherwise you are likely to run into a timing issue with the build numbers.

    • Type: String
  • releaseNumber (optional)

    Select the BuildMaster release to trigger build for:

    • Latest Active Release: will automatically get the latest active release number from BuildMaster for the selected application
    • [Release Number]: alternatively select a specific release number from the list of active releases supplied for the selected application

    During a build the BUILDMASTER_RELEASE_NUMBER environment variable will be set with this value.

    NOTE: if a specific release number is selected (for example an emergency patch might want to go on an earlier release than the latest one) this will become invalid once the release is finalised in BuildMaster. There may be scope for an enhancement here to provide alternative forms of matching on release number - eg by branch name.

    • Type: String

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.