Versions Compared

Key

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

...

Structure

The Jenkins DevOps pipeline is defined in a ‘Jenkinsfile’ (with the default filename Jenkinsfile ) and has an overall structure summarised below. Note that paired curly braces - { } - denote the start and end of a scoped section. Comments can be created in a block (/* comment like this */) or inline (// comment like this).

...

Note that Jenkins offers some flexibility in the structure of the pipeline, and in some cases allows repetition at different scopes. For example, a single Step can optionally contain another Stages {...} container which defines more sub-Stages). To understand these sections in more detail refer to the Jenkins documentation. This documentation describes the sample Jenkins pipelines supplied with MettleCI.

...

The agent section denotes what class of machines your pipeline can be executed on. For a CI/CD pipeline, you only need to specify this once since all projects are at the same release level. For an Upgrade pipeline you may want to specify the agents within the stage so that different stages run on different release levels. In the example below the label should match the label you gave your agent on the MettleCI host when you set it up. Pipelines will stall if no running agent with the (matching set of) label(s) is found.

Code Block
    agent {
        label 'mettleci:datastage11.7.1'
    }

Parameters section

The parameters section enumerates the parameters to the pipeline with their default values. The four parameters used in the template, and their meanings are discussed in /wiki/spaces/MCIDOC/pages/741310474

...

Code Block
    parameters {
        string(name: 'domainName', defaultValue: 'demo4-svcsservices_tier.datamigrators.io:59445', description: 'DataStage Service Tier')
        string(name: 'serverName', defaultValue: 'demo4-engnengine_tier.datamigrators.io', description: 'DataStage Engine Tier')
        string(name: 'projectName', defaultValue: 'wwi_jenkins_ds117', description: 'Logical (unsuffixed) Project Name')
        string(name: 'environmentId', defaultValue: 'ci', description: 'Environment Identifer')
    }

When run interactively, the user will be prompted for these at pipeline start time like so:

...

Environment Section

The environment section allows you to derive and set further useful variables. The template pipeline composes the suffixed DataStage project and copies one of the parameters to an all uppercased variable for convenience later.

...