CI/CD orchestrator Use Cases with Code Pipeline


BMC AMI DevX Code Pipeline integrates seamlessly with modern CI/CD orchestrators to automate mainframe delivery alongside distributed applications. While the core CI/CD flow is consistent, the implementation details vary by orchestrator, driven by the DSL (pipeline language) they use (Groovy in Jenkins, YAML in Azure and GitHub, pipeline configuration in Bitbucket), and by the plugins or extensions BMC provides.

Each orchestrator follows the same end-to-end process:

  1. Trigger (Code Pipeline webhook or Git event)
  2. Prepare workspace (clean, set environment, load configuration)
  3. Download mainframe sources from Code Pipeline.
  4. Clone and prepare Total Test projects.
  5. Run tests (virtualized, non-virtualized, intelligent execution).
  6. Collect Code Coverage metrics.
  7. Run SonarQube analysis (sources, tests, coverage).
  8. Check quality gates and enforce pass or fail actions.
  9. Deploy or regress in Code Pipeline.
  10. Report and notify (JUnit, coverage, Sonar, zAdviser, email,Slack or Teams).

The following sections provide detailed use cases for Jenkins, Azure DevOps, GitHub Actions, and Bitbucket. These are customer-ready and technically precise, showing how the CI/CD works from trigger to deployment in each orchestrator.

Jenkins CI/CD Use Case with Code Pipeline

Jenkins is the most deeply integrated orchestrator in the BMC DevOps ecosystem. The BMC Jenkins plugin provides first-class DSL steps (ispwOperation, totaltest, CodeCoverageBuilder) that simplify integration with Code Pipeline, Total Test, and Code Coverage. Shared Libraries allow enterprise teams to scale these pipelines across multiple applications.

Step-by-step flow:

1. Trigger

  • Pipeline is triggered by a Code Pipeline webhook when a Promote or Generate event occurs.
  • Webhook parameters (ISPW_Assignment, ISPW_Stream, ISPW_Application, ISPW_Changed_Programs_File) are passed into Jenkins automatically.
  • Alternative trigger: Git push or PR if Git -> Code Pipeline synchronization is enabled.

2. Prepare Workspace

  • Jenkins cleans the workspace.
  • Loads configuration files (ispwconfig.yml, synchronization.yml)
  • Resolves credentials from Jenkins credentials store (CES tokens, Git credentials, Sonar tokens)

3. Download Mainframe Sources

  • Uses the BMC Jenkins plugin DSL:

    checkout(

                   [

                       $class:             'IspwContainerConfiguration', 

                       connectionId:       HCI_Conn_ID,

                       credentialsId:      HCI_Token, 

                       componentType:      '', 

                       containerName:      ISPW_Set_id

                       containerType:      '2', 

                       ispwDownloadAll:    false, 

                       ispwDownloadIncl:   true, 

                       serverConfig:       ISPW_Runtime, 

                       serverLevel:        ISPW_Src_Level

                   ]

  • Sources are downloaded into the sources or folder.
  • --resolveCopybooks ensures all dependencies (copybooks) are pulled.

4. Clone and prepare Test projects

  • Jenkins clones the Total Test Git repository into Tests/
  • Subfolders are used for:
    • Virtualized_Tests (unit or isolated tests)
    • NonVirtualized_Tests (integration or system tests)

5. Run Tests

  • Executes tests using the Jenkins totaltest(...) DSL step.
  • Supports:
    • Virtualized tests with mocks/stubs.
    • Non-virtualized tests against live subsystems.
  • Intelligent Test Execution:
    • Uses ISPW_Changed_Programs_File to run only impacted tests.

Example:

totaltest folderPath: "${TESTS_DIR}/Virtualized_Tests",

          jsonFile: ISPW_CHANGED_FILE,

          collectCodeCoverage: true,

          junitReport: "${REPORTS_DIR}/virtualized.xml"

6. Collect Code Coverage

  • Coverage data is downloaded from the Code Coverage repository.
  • Mapped to local sources using cc.properties (e.g., cc.sources=./sources).
  • Coverage XML saved in Coverage/coverage.xml.

7. Run SonarQube Analysis

  • Jenkins runs sonar-scanner inside a withSonarQubeEnv block:

    sonar-scanner \

      -Dsonar.projectKey=MainframeApp \

      -Dsonar.sources=./sources \

      -Dsonar.tests=./Tests \

      -Dsonar.coverageReportPaths=Coverage/coverage.xml \

      -Dsonar.junit.reportPaths=Reports/**/*.xml

8. Check Quality Gates

  • Jenkins waits for SonarQube quality gate result:

waitForQualityGate abortPipeline: true

  • If gate fails -> pipeline stops, regression triggered.
  • If gate passes -> pipeline continues to deployment.

9. Deploy or Regress

  • On pass: Deploy assignment or release to next level:

    ispwOperation(

      connectionId: 'CES_Conn',

      credentialsId: 'CES_Token',

      ispwAction: 'DeployAssignment',

      ispwRequestBody: "assignmentId=${ISPW_ASSIGNMENT}"

    )

  • On fail: Automatically regress assignment:

    ispwOperation(

      connectionId: 'CES_Conn',

      credentialsId: 'CES_Token',

      ispwAction: 'RegressAssignment',

      ispwRequestBody: "assignmentId=${ISPW_ASSIGNMENT}"

    )

10. Reporting and notifications

  • JUnit reports published in Jenkins
  • Coverage and Sonar results archived as artifacts
  • Notifications sent via Jenkins plugins (email, Teams, Slack)
  • Metrics can be exported to zAdviser for enterprise analytics

Azure DevOps CI/CD Use Case with Code Pipeline

Azure DevOps pipelines integrate with Code Pipeline CI/CD through YAML build pipelines and Release pipelines. BMC provides example PowerShell scripts (CodePipeline_Operations.ps1, TTT_Run_Tests.ps1, Code_Coverage_Download_Metrics.ps1) that the pipeline executes. The workflow mirrors Jenkins but uses native Azure tasks for orchestration, secrets, and SonarQube integration.

Step-by-step flow

1. Trigger

  • Triggered by:
    • Code Pipeline webhook (Promote/Generate event).
    • Git push or PR to main branch.
  • Pipeline variables (ISPW_Assignment, ISPW_Set_id, ISPW_Changed_Programs_File) are passed into the pipeline.
  • Pipeline is triggered by a Code Pipeline webhook when a Promote or Generate event occurs.
  • Webhook parameters (ISPW_Assignment, ISPW_Stream, ISPW_Application, ISPW_Changed_Programs_File) are passed into Jenkins automatically.
  • Alternative trigger: Git push/PR if Git -> Code Pipeline synchronization is enabled.

2. Prepare workspace

  • Azure DevOps agent cleans workspace automatically at job start.
  • Environment variables and service connections (CES URL, CES Token, Git, Sonar token) are securely injected from Azure Key Vault or pipeline secrets.

3. Download mainframe sources

  • Pipeline calls the BMC PowerShell script:

    ./pipeline/ispw-scripts/CodePipeline_Operations.ps1 `

        -Action GetSetInfo `

        -SetId $(ISPW_Set_id) `

        -OutDir sources `

        -CesUrl $(CES_URL) `

        -CesToken $(CES_TOKEN

  • Sources are downloaded into sources or folder with copybook resolution.

4. Clone and prepare test projects

  • Pipeline runs a Git step:
    - script: git clone https://dev.azure.com/org/totaltest-repo.git Tests
  • Organizes into:
    • Tests/Virtualized_Tests
    • Tests/NonVirtualized_Tests

5. Run Tests

  • Pipeline calls BMC’s TTT_Run_Tests.ps1 script:

    ./pipeline/ispw-scripts/TTT_Run_Tests.ps1 `

        -Project "Tests/Virtualized_Tests" `

        -ChangeFile $(ISPW_Changed_Programs_File) `

        -OutDir Reports/Virtualized

  • Supports:
    • Virtualized tests using TTT_Vt_Environment.
    • Non-virtualized tests using TTT_NonVirtualized_Environment.
  • Intelligent Test Execution runs only impacted tests.

6. Collect Code Coverage

  • Uses PowerShell script to download coverage:

    ./pipeline/ispw-scripts/Code_Coverage_Download_Metrics.ps1 `

        -Assignment $(ISPW_Assignment) `

        -OutFile Coverage/coverage.xml `

        -SourcesDir sources

  • Coverage mapped to local source folder (cc.sources=sources).

7. Run SonarQube analysis

  • Azure DevOps provides SonarQube tasks:

    - task: SonarQubePrepare@5

      inputs:

        SonarQube: 'SonarQubeService'

        scannerMode: 'CLI'

        cliProjectKey: 'MainframeApp'

        cliSources: 'sources'

    - task: SonarQubeAnalyze@5

    - task: SonarQubePublish@5

      inputs:

        pollingTimeoutSec: '300'

  • Uploads:
    • sources/
    • Tests/
    • Reports/ (JUnit XML)
    • Coverage/coverage.xml

8. Check Quality gates

  • SonarQubePublish@5 checks gate result.
  • If fail -> build marked as failed; next Release stage blocked.
  • If pass -> triggers Release pipeline.

9. Deploy or regress

  • Deployment handled in Release pipeline, not the build pipeline.
  • Release stage calls CodePipeline_Operations.ps1 for deployment:

    ./pipeline/ispw-scripts/CodePipeline_Operations.ps1 `

        -Action DeployAssignment `

        -AssignmentId $(ISPW_Assignment) `

        -CesUrl $(CES_URL) `

        -CesToken $(CES_TOKEN)

  • If tests or gates fail -> call regression action (RegressAssignment).

10. Reporting and notifications

  • Test results exported as JUnit for Azure Test Reports
  • Coverage uploaded as pipeline artifact
  • SonarQube dashboard integrated in Azure portal
  • Notifications via Azure DevOps (Email, Teams, or Service hooks)

GitHub Actions CI/CD Use Case with Code Pipeline

GitHub Actions integrates Code Pipeline into modern DevOps workflows using workflow YAML files. The pipeline is executed on self-hosted runners configured with CLI tools. Like Jenkins and Azure DevOps, it automates the same mainframe CI/CD steps - download, test, coverage, analysis, quality gate, and deploy or regress.

Important
For details on setting up a Git repository to integrate with Code Pipeline refer to the Git to Code Pipeline Synchronization.

Step-by-step flow

1. Trigger

  • Triggered by:
    • Git push or PR to the repositor or Code Pipeline webhook (Promote/Generate event) hitting a GitHub Actions endpoint.
  • Workflow inputs: ISPW_Assignment, ISPW_Set_id, ISPW_Changed_Programs_File.

2. Prepare Workspace

  • GitHub Actions runner automatically checks out repository with:

- name: Checkout Repo

  •  uses: actions/checkout@v3
  • Secrets (CES_URL, CES_TOKEN, SONAR_TOKEN) injected securely from GitHub Secrets.
  • Workspace directories created for sources/, Tests/, Coverage/, and Reports/.

3. Download Mainframe Sources

  • CLI call to SCM Downloader:

SCMDownloaderCLI --cesUrl ${{ secrets.CES_URL }} \

                 --cesToken ${{ secrets.CES_TOKEN }} \

                 --container ${{ env.ISPW_ASSIGNMENT }} \

                 --resolveCopybooks \

                 --outDir sources

  • Retrieves sources from Code Pipeline container (assignment, release, or set).

4. Clone and prepare Test projects

  • GitHub workflow step to fetch Total Test repository:

- name: Clone Total Test Assets

  •   run: git clone https://github.com/org/totaltest-repo.git Tests
  • Organize into:
    • Tests/Virtualized_Tests
    • Tests/NonVirtualized_Tests

5. Run Tests

  • Invoke TotalTestFTCLI for virtualized tests:

TotalTestFTCLI -project Tests/Virtualized_Tests \

               -changeFile ${{ env.ISPW_Changed_Programs_File }} \

               -out Reports/Virtualized

  • Similarly for non-virtualized tests.
  • Intelligent Test Execution ensures only impacted tests run.

6. Collect Code Coverage

  • Download coverage metrics:

CodeCoverageDownloader --assignment ${{ env.ISPW_ASSIGNMENT }} \

                       --out Coverage/coverage.xml \

                       --cc.sources=sources

  • Coverage XML mapped to local sources for SonarQube.

7. Run SonarQube Analysis

  • Run Sonar scanner with CLI:

    sonar-scanner \

      -Dsonar.projectKey=MainframeApp \

      -Dsonar.sources=./sources \

      -Dsonar.tests=./Tests \

      -Dsonar.coverageReportPaths=Coverage/coverage.xml \

      -Dsonar.junit.reportPaths=Reports \

      -Dsonar.login=${{ secrets.SONAR_TOKEN }}

  • Uploads sources, tests, results, and coverage to SonarQube.

8. Check Quality Gates

  • Quality gate result retrieved via SonarQube API or sonar-quality-gate GitHub action.
  • If gate fails -> job stops, regress assignment.
  • If gate passes -> pipeline proceeds to deployment.

9. Deploy or Regress

  • Deploy assignment with CLI:

ispwOperation --action DeployAssignment \

              --assignmentId ${{ env.ISPW_ASSIGNMENT }} \

              --cesUrl ${{ secrets.CES_URL }} \

              --cesToken ${{ secrets.CES_TOKEN }}

  • Regress assignment if gate or tests fail:

ispwOperation --action RegressAssignment \

              --assignmentId ${{ env.ISPW_ASSIGNMENT }} \

              --cesUrl ${{ secrets.CES_URL }} \

              --cesToken ${{ secrets.CES_TOKEN }}

10. Reporting and notifications

  • Test results uploaded as GitHub Actions artifacts.
  • Coverage XML and reports archived for download.
  • Workflow status visible in pull request checks.
  • Optional integration with Slack or Teams using GitHub Actions marketplace actions.

Bitbucket Pipelines CI/CD Use Case with Code Pipeline

Bitbucket Pipelines integrates with Code Pipeline through a bitbucket-pipelines.yml file. Each step runs in a Docker container or on a self-hosted runner with the required CLI tools installed (Workbench CLI, Total Test CLI, SonarScanner). The pipeline automates source download, testing, coverage, analysis, and deployment using the same sequence as Jenkins, Azure DevOps, and GitHub actions.

Important
For details on setting up a Git repository to integrate with Code Pipeline refer to the Git to Code Pipeline Synchronization.

Step-by-step flow

1. Trigger

  • Triggered by:
    • Git push or PR in Bitbucket repository or Code Pipeline webhook calling Bitbucket’s pipeline trigger API.
  • Variables such as ISPW_Assignment, ISPW_Set_id, ISPW_Changed_Programs_File are passed into the pipeline via environment variables.

2. Prepare Workspace

  • Bitbucket agent spins up a container (for example, openjdk:11 or custom image with CLI preinstalled).
  • Environment variables injected from Bitbucket repository variables or secure pipelines secrets (CES URL, CES Token, Sonar Token).
  • Workspace directories created: sources/, Tests/, Coverage/, Reports/.

3. Download Mainframe Sources

  • Use CLI inside pipeline step:

SCMDownloaderCLI --cesUrl $CES_URL \

                 --cesToken $CES_TOKEN \

                 --container $ISPW_ASSIGNMENT \

                 --resolveCopybooks \

                 --outDir sources

  • Fetches Code Pipeline sources and dependencies.

4. Clone and Prepare Test Projects

  • Clone Total Test assets from Bitbucket or another Git repository:

git clone https://bitbucket.org/org/totaltest-repo.git Tests

  • Organize into:
    • Tests/Virtualized_Tests
    • Tests/NonVirtualized_Tests

5. Run Tests

  • Execute Total Test CLI:

TotalTestFTCLI -project Tests/Virtualized_Tests \

               -changeFile $ISPW_Changed_Programs_File \

               -out Reports/Virtualized

  • Non-virtualized tests executed in the same way.
  • Intelligent Test Execution supported using ISPW_Changed_Programs_File.

6. Collect Code Coverage

  • Run Code Coverage downloader CLI:

CodeCoverageDownloader --assignment $ISPW_ASSIGNMENT \

                       --out Coverage/coverage.xml \

                       --cc.sources=sources

  • Coverage file mapped to local sources for SonarQube.

7. Run SonarQube Analysis

  • Run scanner inside container:
    sonar-scanner \

    -Dsonar.projectKey=MainframeApp \

     -Dsonar.sources=./sources \

     -Dsonar.tests=./Tests \

     -Dsonar.coverageReportPaths=Coverage/coverage.xml \

     -Dsonar.junit.reportPaths=Reports \

     -Dsonar.login=$SONAR_TOKEN

  • Sends sources, tests, results, and coverage metrics to SonarQube.

8. Check Quality Gates

  • Gate status checked via SonarQube API or plugin.
  • If fail → stop pipeline, regress assignment.
  • If pass → continue to deployment step.

9. Deploy or Regress

  • Deploy assignment:

    ispwOperation --action DeployAssignment \

                  --assignmentId $ISPW_ASSIGNMENT \

                  --cesUrl $CES_URL \

                  --cesToken $CES_TOKEN

  • Regress assignment if gate/test fails:

    ispwOperation --action RegressAssignment \

                  --assignmentId $ISPW_ASSIGNMENT \

                  --cesUrl $CES_URL \

                  --cesToken $CES_TOKEN

10. Reporting and notifications

  • Artifacts (JUnit XML, coverage reports, logs) uploaded using artifacts:
    Directive in bitbucket-pipelines.yml.
  • Build or test results available in Bitbucket pipelines UI.
  • Notifications via Bitbucket integrations (Slack, email, Jira)

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

Integrating BMC AMI DevX Code Pipeline into CI/CD workflows