Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt

This plugin integrates Inedo BuildMaster to Jenkins allowing Jenkins jobs to gather version information from BuildMaster and trigger builds on an application.


Usage

First, you need to ensure that an api key as been configured in BuildMaster at BuildMaster > Administration > All Settings > ApiKey.  Without this the plugin won't be able access BuildMaster.

Next, you need to go to Jenkins' system config screen to tell Jenkins where's your BuildMaster resides.  I have found that I need to configure it for NTLM authentication otherwise my account gets locked out.  Clicking the "Test Connection" button a few times will confirm whether this is required or not.

Lastly, you need to add a couple of steps to your Jenkins job.  Because the Release and Build numbers could be required by several build and post-build actions selecting the application and has been separated from the trigger build action.

The "Select BuildMaster Application" build step allows you to select the the BuildMaster application you are dealing with and the settings will be used to inject these environment variables into the job at build time:

    BUILDMASTER_APPLICATION_ID
    BUILDMASTER_RELEASE_NUMBER
    BUILDMASTER_BUILD_NUMBER
    BUILDMASTER_DEPLOYABLE_ID

Ignore the Deployable option for the moment, that will be covered in the advanced topics section later in this document.

The "Trigger Build" action can be added as either a build step or post build action.  The choice of which to use will be largely dependent on how you import the build artifacts into BuildMaster and your personal preference:

    You are using the BuildMaster Jenkins Build Importer Build Step which imports build artifacts from Jenkins: the post build action is required
    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
    You use an external artifact repository such as Nexus or Artifactory: either the post build or build step actions will be fine

If you haven't used the "Select BuildMaster Application" action then you will need to go into the advanced section and set the application id, release and build number details.

To deploy the build to the first environment ensure that you have the post-build step action "Auto-Promote Build to the Next Environment" set in BuildMaster.
Advanced Topics
Multiple Jenkins Jobs Using A Single BuildMaster Application

If you have multiple Jenkins jobs all triggering a build for the same BuildMaster application check out the following two 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.

    "Enable Deployable in BuildMaster": selectively enable deployables for a release
        In BuildMaster you must ensure that Deployables are disabled by default for a release
        The "Select BuildMaster Application" Deployable option must be set to the correct deployable
    "Copy Previous Build's Variables": 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 could be useful if you're only passing in pointers to a version, eg you keep your artficats in Artifactory or Nexus.