Task03
Trigger CI Pipeline

Trigger CI Pipeline

Check Branch

Before starting this lab, make sure you are on the stage branch


git branch --show-current


stage

Step 1 - Commit code to local stage branch

Make sure you are in the root directory of the project folder


cd ~/workspace/CiscoLive/DEVWKS-3928

First issue the git status . command to see the list of files that have been modified in the previous lab tasks.


git status .



On branch stage
Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git restore ..." to discard changes in working directory)
        modified:   group_vars/all/overlay.yml
        modified:   group_vars/prod/fabric.yml
        modified:   group_vars/prod/overlay.yml
        modified:   group_vars/stage/fabric.yml
        modified:   group_vars/stage/overlay.yml
        modified:   hosts.prod.yml
        modified:   hosts.stage.yml
        modified:   roles/configure_overlay/files/cisco_live_attach_nets.yml
        modified:   roles/configure_overlay/files/cisco_live_attach_vrfs.yml

Untracked files:
  (use "git add ..." to include in what will be committed)
        .gitlab-ci.yml
        roles/configure_overlay/action_plugins/__pycache__/

no changes added to commit (use "git add" and/or "git commit -a")

Check Closely!

Make sure your modified list of files matches the list of files above in the lab guide. If it does not then that means you missed a step or did not save one of the files you modified.

Now commit the code to your github repo.


git add .
git commit -a -m "initial setup"



git commit -a -m "initial setup"
[stage 6eb538d] initial setup
 11 files changed, 267 insertions(+), 10 deletions(-)
 create mode 100644 .gitlab-ci.yml
 rewrite group_vars/prod/fabric.yml (100%)
 rewrite group_vars/stage/fabric.yml (100%)
 rewrite hosts.prod.yml (100%)
 rewrite hosts.stage.yml (100%)
 create mode 100644 roles/configure_overlay/action_plugins/__pycache__/fabric_check_sync.cpython-310.pyc
 rewrite roles/configure_overlay/files/cisco_live_attach_nets.yml (100%)


Step 2 - Push local branch stage to remote


git push --set-upstream origin stage 


Enumerating objects: 40, done.
Counting objects: 100% (33/33), done.
Delta compression using up to 8 threads
Compressing objects: 100% (22/22), done.
Writing objects: 100% (22/22), 4.25 KiB | 1.42 MiB/s, done.
Total 22 (delta 4), reused 0 (delta 0), pack-reused 0
remote: 
remote: To create a merge request for stage, visit:
remote:   http://10.15.0.159/Pod20_2025_01/DEVWKS-3928/-/merge_requests/new?merge_request%5Bsource_branch%5D=stage
remote: 
To 10.15.0.159:Pod20_2025_01/DEVWKS-3928.git
 * [new branch]      stage -> stage
Branch 'stage' set up to track remote branch 'stage' from 'origin'.


Step 3 - Check the code on gitlab

Login to the GitLab instance by clicking the URL below or copying the URL into a new tab in your browser window:

Login using the information below:

  • Username: pod03
  • Password: c1sco.123
  • Then click Sign in

Select stage branch:

  1. Click main
  2. Click stage branch


Step 4 - Check to make sure the Lint Stage was run.

As soon as the code was committed to the stage branch, Ansible Lint validation was triggered, open pipelines:

  1. Hover over Build on the side menu
  2. Then click Pipelines


Only the lint stage is triggered when committing the code to the stage branch, circle check icon indicates pipeline succeeds

To see details of the job Click passed under the Status column

This shows the ansible_lint job ran successfully for the initial setup commit.



Step 5 - Create a Merge Request (Also known as a pull request)

Now we need to create merge request to verify/test the configuration against the NDFC staging environment fabric.

  1. Hover over Code on the side menu
  2. Then click Merge Requests

  3. Click New Merge Requests

  4. Select stage as Source branch
  5. Select main as Target branch
  6. Then click Compare branches and continue

  7. Leave all of the fields with the default settings, then click Create merge request

  8. Click theh circle icon in screen below to navigate to pipeline page

  9. Wait until the pipeline finishes, if any pipeline fails, you can click the step to check the error message


Step 6 - Verfiy on NDFC

In your browser, open another instance of the browser or another tab. Copy the url of Nexus Dashboard:

  • ND URL: https://10.15.0.17/appcenter/cisco/ndfc/ui/lan-fabric/fabrics
  • Username: admin
  • Password: cisco.123

Open fabric page and open fabric-stage, and verify VRF and Networks are provisioned: