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:
- A Jenkins Agent hosting a MettleCI Command Line on a DataStage v11.5 Client Tier
Status |
---|
colour | Purple |
---|
title | mettleci: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 |
---|
title | 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.
...
This table summaries the Agent Label required for each Stage of the sample pipeline:
Stage | Agent LabelLabels |
---|
Diagnostics 11.5 (Legacy) | Status |
---|
colour | Blue |
---|
title | mettleci:Windows |
---|
|
Status |
---|
colour | Yellow |
---|
title | mettleci |
---|
|
Status |
---|
colour | Purple |
---|
title | datastage11.5.1 |
---|
| (Legacy) |
Diagnostics 11.7 (Target) | Status |
---|
colour | PurpleYellow |
---|
title | mettleci: |
---|
|
Status |
---|
colour | Green |
---|
title | datastage11.7.1 |
---|
| (Target) |
Create DSParams Diff Artifact | Status |
---|
colour | Yellow |
---|
title | mettleci: |
---|
|
Status |
---|
colour | Purple |
---|
title | datastage11.5.1 |
---|
| (Legacy) |
Deploy - Legacy CI | Status |
---|
colour | Blue |
---|
title | mettleci:Windows |
---|
|
Status |
---|
colour | Yellow |
---|
title | mettleci |
---|
|
Status |
---|
colour | Purple |
---|
title | datastage11.5.1 |
---|
| (Legacy) |
Test - Legacy CI | Status |
---|
colour | Blue |
---|
title | mettleci:Windows |
---|
|
Status |
---|
colour | Yellow |
---|
title | mettleci |
---|
|
Status |
---|
colour | Purple |
---|
title | datastage11.5.1 |
---|
| (Legacy) |
Deploy - Target CI | Status |
---|
colour | PurpleYellow |
---|
title | mettleci: |
---|
|
Status |
---|
colour | Green |
---|
title | datastage11.7.1 |
---|
| (Target) |
Test - Target CI | Status |
---|
colour | PurpleBlue |
---|
title | Windows |
---|
|
Status |
---|
colour | Yellow |
---|
title | mettleci: |
---|
|
Status |
---|
colour | Green |
---|
title | datastage11.7.1 |
---|
| (Target) |
Deploy - Target QA | Status |
---|
colour | PurpleYellow |
---|
title | mettleci: |
---|
|
Status |
---|
colour | Green |
---|
title | datastage11.7.1 |
---|
| (Target) |
Deploy - Target Performance | Status |
---|
colour | PurpleYellow |
---|
title | mettleci: |
---|
|
Status |
---|
colour | Green |
---|
title | datastage11.7.1 |
---|
| (Target) |
Deploy - Target Prod | Status |
---|
colour | PurpleBlue |
---|
title | Windows |
---|
|
Status |
---|
colour | Yellow |
---|
title | mettleci: |
---|
|
Status |
---|
colour | Green |
---|
title | datastage11.7.1 |
---|
| (Target) |