-
Notifications
You must be signed in to change notification settings - Fork 11
Pipeline updates #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Pipeline updates #51
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| --- | ||
| image: mtarking/nac-vxlan:24.0.1 | ||
| image: danischm/nac:0.1.5 | ||
| stages: | ||
| - setup | ||
| - validate | ||
| - deploy | ||
| - test | ||
|
|
@@ -23,42 +24,76 @@ variables: | |
| NDFC_SW_PASSWORD: | ||
| description: "Cisco NDFC Switch Password" | ||
|
|
||
| cache: | ||
| paths: | ||
| - .pip_cache/ | ||
|
|
||
| setup: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a one time action where you're using this for each stage or does each stage need a
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to check this again, I remember adding this as subsequent stages were showing error with missing packages. |
||
| stage: setup | ||
| rules: | ||
| - if: $CI_COMMIT_TAG == null | ||
| script: | ||
| - echo "Setting up environment..." | ||
| - pip install --cache-dir .pip_cache -r requirements.txt --force-reinstall | ||
| - ansible-galaxy collection install -U -f -p ./collections/ansible_collections/ -r requirements.yaml | ||
| artifacts: | ||
| paths: | ||
| - collections/ansible_collections/ | ||
|
|
||
| validate: | ||
| stage: validate | ||
| dependencies: | ||
| - setup | ||
| needs: | ||
| - setup | ||
| rules: | ||
| - if: $CI_COMMIT_TAG == null | ||
| script: | ||
| - set -o pipefail && ansible-playbook -i inventory.yml ndfc_validate.yml |& tee validate_output.txt | ||
| - set -o pipefail && ansible-playbook -i inventory.yaml ndfc_validate.yaml |& tee nac_fabric1_validate_output.txt | ||
| artifacts: | ||
| paths: | ||
| - validate_output.txt | ||
| - nac_fabric1_validate_output.txt | ||
| - collections/ansible_collections/ | ||
| cache: [] | ||
|
|
||
| deploy: | ||
| stage: deploy | ||
| dependencies: | ||
| - setup | ||
| - validate | ||
| needs: | ||
| - setup | ||
| - validate | ||
| rules: | ||
| - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH | ||
| when: manual | ||
| script: | ||
| - set -o pipefail && ansible-playbook -i inventory.yml vxlan.yml |& tee deploy_output.txt | ||
| - pip install --cache-dir .pip_cache -r requirements.txt | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, need to work on this pieline PR again. |
||
| - set -o pipefail && ansible-playbook -i inventory.yaml vxlan.yaml |& tee nac_fabric1_deploy_output.txt | ||
| artifacts: | ||
| when: always | ||
| paths: | ||
| - nac_fabric1_deploy_output.txt | ||
| cache: [] | ||
|
|
||
| test-integration: | ||
| stage: test | ||
| dependencies: | ||
| - setup | ||
| - deploy | ||
| needs: | ||
| - setup | ||
| - deploy | ||
| rules: | ||
| - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH | ||
| script: | ||
| - set -o pipefail && iac-test -d ./host_vars/nac-ndfc1 -d ./group_vars/ndfc/defaults.yaml -t ./tests/templates -f ./tests/filters -o ./tests/results/ndfc |& tee test_output.txt | ||
| - pip uninstall -y nac-test || true | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why uninstall?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the Docker image had nac-test included and it was getting called when we run iac-test, which was causing issues with the robot tests as those are not supported yet for nac-test, so I had to remove this. |
||
| - pip install --cache-dir .pip_cache -r requirements.txt | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned above, need to work on this again. |
||
| - set -o pipefail && iac-test -d ./host_vars/nac-fabric1 -d ./group_vars/ndfc/defaults.yaml -t ./tests/templates -o ./tests/results/nac-fabric1 |& tee test_output.txt | ||
| artifacts: | ||
| when: always | ||
| paths: | ||
| - tests/results/ndfc/*.html | ||
| - tests/results/ndfc/xunit.xml | ||
| - tests/results/nac-fabric1/*.html | ||
| - tests/results/nac-fabric1/xunit.xml | ||
| - test_output.txt | ||
| reports: | ||
| junit: tests/results/ndfc/xunit.xml | ||
| junit: tests/results/nac-fabric1/xunit.xml | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is old PR and need to test and work on the pipeline again, I was performing a few tests and was facing issue with the ansible version download as per requirement.txt. It was working for the nac:0.1.5 image. Please let me know of I can close this and work on a new PR.