Document toolboxDocument toolbox

Jenkins Agent Assignment

In the case of the supplied MettleCI Upgrade Pipeline certain Pipeline operations need to happen in specific Agents - i.e. some operations must execute on your environment’s legacy Agent, whilst others need to be assigned to a target Agent. To achieve this the MettleCI Sample Jenkins Pipeline assumes the availability of two Agent labels which you should have created and assigned:

mettleci datastage11.5- A Jenkins Agent hosting a MettleCI Command Line on a DataStage v11.5 Client Tier

mettlecI datastage11.7- A Jenkins Agent hosting a MettleCI Command Line on a DataStage v11.7.1 Client Tier

You’ll see the labels used in the Pipeline definitions like this:

stages { stage("Some Pipeline Stage") { agent { label 'mettleci datastage11.5' } environment { ENVID = "ci" DATASTAGE_PROJECT = "${env.IIS_BASE_PROJECT_NAME}_${env.ENVID}" } steps { ... }

Note that the DevOps Pipeline only assumes the presence of a single Agent with the mettleci:datastage11.7.1 label, as all operations can execute there.

Assigning Pipeline operations to Agents using Labels

The agent sections of your Jenkins Pipeline definition denote which Jenkins Agents your Pipeline can be executed on. More specifically, it denotes which labels will be used to dynamically select an execution Agent from the pool of available Agents.

MettleCI ships with two sample Jenkins Pipelines, each of which have different Agent requirements:

A DevOps Pipeline, which performs CI/CD of a DataStage changeset and is described in generic terms here, and

An Upgrade Pipeline, which, like the DevOps pipeline, performs CI/CD of a DataStage changeset before deploying the code to a newly-upgraded DataStage environment, upgrading your DataStage assets and rerunning Unit Tests to verify the efficacy of the upgrade. This pipeline is described in generic terms here.

The Jenkins Agent specification requirements of each of these is described below.

DevOps Pipeline

The DevOps Pipeline is the simpler of the two Jenkins Pipelines shipped with MettleCI. It responds to a commit of a DataStage asset by performing MettleCI Compliance and Unit Tests before deploying to one or more downstream QA or Production environments. This assumes a simple deployment topology with a single Jenkins Agent running on a single MettleCI Agent host.

Upgrade Pipeline

For an Upgrade pipeline you will need to differentiate between Stages which run on your Legacy Agent and those which need to run on your Target Agent(s). Note that Pipelines will stall if no running Agent with a label (or labels) is found.

This table summaries the Agent Label required for each Stage of the sample pipeline:

Stage

Agent Labels

Stage

Agent Labels

Diagnostics 11.5 (Legacy)

Windows mettleci datastage11.5.1 (Legacy)

Diagnostics 11.7 (Target)

Windows mettlecidatastage11.7.1 (Target)

Create DSParams Diff Artifact

Windows mettlecidatastage11.5.1 (Legacy)

Deploy - Legacy CI

Windows mettlecidatastage11.5.1 (Legacy)

Test - Legacy CI

Windows mettlecidatastage11.5.1 (Legacy)

Deploy - Target CI

Windows mettlecidatastage11.7.1 (Target)

Test - Target CI

Windows mettlecidatastage11.7.1 (Target)

Deploy - Target QA

Windows mettlecidatastage11.7.1 (Target)

Deploy - Target Performance

Windows mettlecidatastage11.7.1 (Target)

Deploy - Target Prod

Windows mettlecidatastage11.7.1 (Target)

 

 

© 2015-2024 Data Migrators Pty Ltd.