stages: - validate - deploy_staging - cleanup_staging - deploy_production find_config: stage: validate image: python:3.12 script: - echo "Searching for device configurations..." - | for f in r1.txt r2.txt r3.txt; do if [ ! -f "$f" ]; then echo "ERROR: Required file '$f' is missing." exit 1 fi done deploy_cml: stage: deploy_staging image: python:3.12 needs: ["find_config"] before_script: - pip install --no-cache-dir virl2-client jinja2 script: - echo "Deploying lab into CML..." - python import.py up cleanup_cml: stage: cleanup_staging image: python:3.12 needs: ["deploy_cml"] before_script: - pip install --no-cache-dir virl2-client jinja2 script: - echo "Removing lab from CML..." - python import.py down when: manual allow_failure: true deploy_devices: stage: deploy_production image: python:3.12 needs: ["deploy_cml"] rules: - if: '$CI_COMMIT_BRANCH == "main"' when: manual script: - echo "This is the placeholder for production deployment." - echo "Ansible / RESTCONF / some other automation goes here." < ... Output Omitted ... > interface GigabitEthernet2 ip address 192.168.10.1 255.255.255.0 no shutdown interface GigabitEthernet3 ip address 172.16.10.1 255.255.255.0 no shutdown interface GigabitEthernet4 ip address 10.10.10.1 255.255.255.0 no shutdown