Versions Compared

Key

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

Assigning Pipeline operations to specific Agents using Labels

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:

Status
colourBlue
titlemettleci:
Status
titledatastage11.5.1
- A Jenkins Agent hosting a MettleCI Command Line on a DataStage v11.5 Client Tier

Status
colourBlue
titlemettlecI
Status
colourPurple
titlemettleci:datastage11.7.1
- A Jenkins Agent hosting a MettleCI Command Line on a DataStage v11.7.1 Client Tier

...

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

Note that the DevOps Pipeline only assumes the presence of a single Agent with the

Status
titlemettleci: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.

...

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

Stage

Agent LabelLabels

Diagnostics 11.5 (Legacy)

Status
colourBlue
titlemettleci:Windows
Status
colourYellow
titlemettleci
Status
colourPurple
titledatastage11.5.1
(Legacy)

Diagnostics 11.7 (Target)

Status
colourBlue
titleWindows
Status
colourPurpleYellow
titlemettleci:
Status
colourGreen
titledatastage11.7.1
(Target)

Create DSParams Diff Artifact

Status
colourBlue
titleWindows
Status
colourYellow
titlemettleci:
Status
colourPurple
titledatastage11.5.1
(Legacy)

Deploy - Legacy CI

Status
colourBlue
titlemettleci:Windows
Status
colourYellow
titlemettleci
Status
colourPurple
titledatastage11.5.1
(Legacy)

Test - Legacy CI

Status
colourBlue
titlemettleci:Windows
Status
colourYellow
titlemettleci
Status
colourPurple
titledatastage11.5.1
(Legacy)

Deploy - Target CI

Status
colourBlue
titleWindows
Status
colourPurpleYellow
titlemettleci:
Status
colourGreen
titledatastage11.7.1
(Target)

Test - Target CI

Status
colourPurpleBlue
titleWindows
Status
colourYellow
titlemettleci:
Status
colourGreen
titledatastage11.7.1
(Target)

Deploy - Target QA

Status
colourBlue
titleWindows
Status
colourPurpleYellow
titlemettleci:
Status
colourGreen
titledatastage11.7.1
(Target)

Deploy - Target Performance

Status
colourBlue
titleWindows
Status
colourPurpleYellow
titlemettleci:
Status
colourGreen
titledatastage11.7.1
(Target)

Deploy - Target Prod

Status
colourPurpleBlue
titleWindows
Status
colourYellow
titlemettleci:
Status
colourGreen
titledatastage11.7.1
(Target)