Setting Up Jenkins Integration

Jenkins is a cross-platform, open-source build automation tool for delivery pipelines. Whether your goal is continuous integration or continuous delivery Jenkins can help automate it.

In order to retrieve the list of parameters for each job, the following Jenkins plugins – Build with Parameters and Extended Read Permission must be installed on your instance of Jenkins. The user configured on the Jenkins integration setup in Plutora must have the Extended Read permission. 

 

1. Set up Jenkins to trigger builds remotely

To build an environment with a single click, using Plutora and Jenkins:

  1. Open Jenkins.
  2. Click a blue-linked job Name.
    Click to open an item in Jenkins red arrow
  3. Click Configure.
    Click Configure in Jenkins red arrow
  4. Click to select the Trigger builds remotely (e.g., from scripts) checkbox.
    Build Triggers Jenkins red arrow
  5. Type an Authentication Token.
  6. Click Save.

 

2. Enable Plutora’s Jenkins integration and Create and Enable a New Jenkins Integration

To enable Jenkins Integration and create and enable a new Jenkins integration:

  1. Go to Settings > Customization > Integrations.
  2. Click Jenkins.
  3. Click to select the Enable Jenkins Integration checkbox to toggle on Jenkins Integration.
  4. Click + New Jenkins Instance at the bottom of the left-hand panel.
  5. Type the Jenkins URL.
  6. Type the Username. (Mandatory field.)
  7. Type the Password/Token. (Mandatory field.)
    Now, you can use either a Username and Password or a Username and API Token to authenticate. 
  8. Click Test Connection.
    If the connection fails, check the Jenkins URL, username, and password or token.
  9. If the connection is successful, click Create.
  10. Enable the new instance by clicking the OFF toggle switch in the left-hand panel until it is blue and ON.

 

3. Enable Jobs

Jenkins Integration now retrieves only the top-level (root) folder of Jenkins jobs and the contents of folders are only retrieved when clicked. This minimizes the level of data coming back in response requests and prevents timeouts.

To enable Jenkins jobs in the new Jenkins instance:

  1. Click Fetch Jobs. The Job Names column should populate with jobs and jobs folders.
  2. Click to select the job checkboxes to enable the jobs.

    Only enabled jobs can be added to a System’s automated jobs list. 
  3. Click Save.

4. Select and Sequence Jenkins Jobs

To select and sequence the Jenkins jobs in a System:

  1. Go to Environment > Systems.
  2. Click to open a System.
  3. Under the Automated Jobs panel:

    1. View a list of the most recent Jenkins builds for all the Jenkins jobs associated with the System:
      • Jobs cascade down to the System’s Environments and those Environments’ TECRs.
      • Jobs are run from the top of the list to the bottom. Reorder jobs by dragging and dropping.
      • The version number produced by the top-listed job is used as the version number in the Environment, but only if all jobs run successfully.
  4. Add or edit Jenkins jobs:
    Jobs must be enabled in Jenkins Customization before they are available to be added to a System.

    1. Click + New Job.
    2. Jenkins is currently the only Application that can be selected.
    3. Select a Jenkins Instance.
    4. Select a Job.
    5. Select Approved Users:
      • If selected, only these users or User Groups can run the job.
      • If no user is selected, anyone with permission to edit the System can run the job.
    6. Select Job Type.
    7. Click Save & Close.

 

5. Select a Component to Update the Version Number

Now set which of the Environment’s components will be updated:

  1. Click the Environment’s Details tab.
  2. Click to select the Summary Version checkbox of the Component which is updated by the job:

  3. Click Update on Build.

    The component’s icon becomes a Jenkins icon.

    • The component’s Version will contain a build version number when a build is initiated.
    • Only one Component can be active with Jenkins at a time.
  4. Click Save & Close.

 

6. Run Jenkins Jobs in a TECR

  1. Go to Environment > Requests.
  2. Click the TECR tab.
  3. Click to open a TECR.
    Environments in the Progression Path of the TECR will contain the Jenkins icon.
  4. To run Jenkins jobs in a TECR:

    1. Click Jobs to open the list of Jenkins jobs that were selected in the TECR’s Environment’s System.

      1. Click to select the checkboxes of jobs you want to run.
      2. Click + Parameters and select the parameters of each of the jobs you have selected.
        Parameters are now set at a TECR level, not an Environment level.
      3. Selected jobs will run in order from the top to the bottom of the list.
      4. Click Save & Close.
      5. Once jobs are selected, the Environment’s status bar will say Ready to Build.
    2. Click Build to run the selected jobs in order:
      • The Ready to build status bar will show the numbered progress through the jobs, for example, 2 of 5.
      • The status bar will continue to show the job progress, even if you click away and back to the TECR.
      • Once the job is complete, Jenkins will update the Environment component’s version number.
        • Plutora Analytics has a Jenkins Executions data cube located under Home / Environments. Track the number of times Jenkins executions have run, for which Environment, for how long, whether the result was a success or a fail, and more.
        • Currently, data created by Jenkins, such as the build version number, will only exist in Plutora if triggered by Plutora. Any changes made in Jenkins alone will not flow back into Plutora. (Unless the user is viewing the versions in the Pipeline.)

7. View the Execution History

TECRs

To view the execution history of a single TECR:

  1. Go to Environment > Requests.
  2. Click to open a TECR.
  3. Click View History in an Environment.

Environments

Environments contain the execution history of all the Environment’s TECRs.

To view an Environment’s Execution History:

  1. Go to Environment > Manager.
  2. Click to open an Environment.
  3. Click the Automated Jobs tab.
  4. Click View Execution History.

Back to the top arrow

Be the first to find out about new features. Subscribe to the Release Notes email. Subscribe Now
Updated on December 15, 2020

Related Articles