We are now going to setup a branch called stage
and commit our GitLab job control file.
Make sure you are in the root directory of the project folder
cd ~/workspace/ndfclab/nac
stage
git checkout -b stage
stage
Branch Changes
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 <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: requirements.yml Untracked files: (use "git add <file>..." to include in what will be committed) .gitlab-ci.yml test.yml validate.yml no changes added to commit (use "git add" and/or "git commit -a")
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.
git add .
Now commit the code to your github repo stage
branch.
git commit -m "Add PipeLine"
[stage e477eeb] Add PipeLine 4 files changed, 264 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 test.yml create mode 100644 validate.yml
stage
to Remote
git push --set-upstream origin stage
Enumerating objects: 6, done. Counting objects: 100% (6/6), done. Delta compression using up to 8 threads Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 1.84 KiB | 940.00 KiB/s, done. Total 5 (delta 1), reused 0 (delta 0), pack-reused 0 remote: remote: To create a merge request for stage, visit: remote: http://10.15.0.159/Pod01_2025_01/LTRDCN-3439/-/merge_requests/new?merge_request%5Bsource_branch%5D=stage remote: To 10.15.0.159:Pod01_2025_01/LTRDCN-3439.git * [new branch] stage -> stage Branch 'stage' set up to track remote branch 'stage' from 'origin'.
Return to GitLab in your browser. In the branch drop-down, select your stage branch:
As soon as the code was committed to the stage branch, Ansible Lint validation was triggered, open pipelines:
Now we need to create merge request to verify/test the configuration against the NDFC staging environment fabric.
The deploy_stage
and test_stage
are doing the following:
deploy_stage
runs the vxlan.yml script against the staging fabric. This is important so that any time you make an update and commit the code in the staging
branch changes will be applied against the staging fabric first.
test_stage
runs the vxlan.yml scripts to verify that changes pushed by the deploy on stage step
did not break anything