Add Notify CI/CD Stage
Final Deployment
  • Introduction
  • NaC Introduction
  • Manual Validation
  • CXTM Introduction
  • CXTM Projects
  • CXTM Test Cases
  • CXTM Test Automation
  • CXTM Git Integration
  • CXTM Batches
  • CXTM Notifications
  • Final Deployment
  • CXTM Reporting
  • CXTM References
  • Bonus Content

Add Notify CI/CD Stage

In this section, you will add a notification stage to your GitLab CI/CD pipeline to send Webex notifications to your team about pipeline execution results. This will keep you informed about successful deployments, failures, or any issues that require attention.


Step 1 - Add Notify Stage to Pipeline

You will now add the notify stage to the stages section of your .gitlab-ci.yml file. This stage will run after the CXTM stage to send Webex notifications about the pipeline execution results.

  1. Copy the following line of code to add the notify stage to your .gitlab-ci.yml file pipeline.

  2. 
      - notify
    
            

  3. Locate the stages section in your .gitlab-ci.yml file and paste - notify as a new stage after - cxtm.
  4. Confirm that your stages section matches the following:
  5. 
    stages:
      - validate
      - plan
      - deploy
      - cxtm
      - notify
    
            

Step 2 - Add Notify Job Configuration

Now you will add the job configuration for the notify stage. This job will send Webex notifications about the pipeline execution status.

  1. Scroll down to the end of your .gitlab-ci.yml file and add the following code to configure the notify stage of your pipeline.

  2. 
    failure:
      stage: notify
      script:
        - python3 .ci/webex-notification-gitlab.py -f
      when: on_failure
      artifacts:
        when: always
        paths:
          - tests/results/nxos/*.html
          - tests/results/nxos/xunit.xml
          - plan.txt
          - fmt_output.txt
          - validate_output.txt
          - test_output.txt
      cache: []
      only:
        - merge_requests
    
    success:
      stage: notify
      script:
        - python3 .ci/webex-notification-gitlab.py -s
      when: on_success
      artifacts:
        when: always
        paths:
          - tests/results/nxos/*.html
          - tests/results/nxos/xunit.xml
          - plan.txt
          - fmt_output.txt
          - validate_output.txt
          - test_output.txt
      cache: []
      only:
        - merge_requests 
    
            

  3. Confirm that your .gitlab-ci.yml file matches the screenshot below before going to the next step.



  4. Press Ctrl + s to save the .gitlab-ci.yml file.
    If the keyboard shortcut does not work, please open the VS Code Server hamburger menu and click File > Save.

Continue to the next section to add additional leaf switches to your data center fabric.