Add Debian, Ubuntu and Alpine gating for XtestingCI 20/74820/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Fri, 14 Mar 2025 07:51:24 +0000 (08:51 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Fri, 14 Mar 2025 07:51:24 +0000 (08:51 +0100)
Change-Id: I876d12def7ac14d20c3e26f21415de1363ec6afe
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
jjb/functest/xtesting-ci.yaml

index 1d8c533..759315a 100644 (file)
@@ -4,8 +4,8 @@
     builders:
       - shell: |
           set +x
-          sudo apt-get -o DPkg::Lock::Timeout=300 update
-          sudo DEBIAN_FRONTEND=noninteractive apt-get \
+          sudo apt -o DPkg::Lock::Timeout=300 update
+          sudo DEBIAN_FRONTEND=noninteractive apt \
             -o DPkg::Lock::Timeout=300 install python3-pip docker.io -y
           curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.17.0/kind-linux-amd64
           chmod +x ./kind
           sudo systemctl daemon-reload
           sudo systemctl restart docker
           if [ $(lsb_release -r -s |cut -d\. -f1) -ge "22" ]; then
-            sudo DEBIAN_FRONTEND=noninteractive apt-get \
+            sudo DEBIAN_FRONTEND=noninteractive apt \
               -o DPkg::Lock::Timeout=300 install podman -y
             sudo podman ps -aq |xargs sudo podman stop || true
             sudo podman ps -aq |xargs sudo podman rm || true
           fi
           sudo rm -rfv /data /tmp/xtesting*
           if [ $(lsb_release -r -s |cut -d\. -f1) -ge "24" ]; then
-            sudo DEBIAN_FRONTEND=noninteractive apt-get \
+            sudo DEBIAN_FRONTEND=noninteractive apt \
               -o DPkg::Lock::Timeout=300 install ansible patch -y
           else
-            sudo DEBIAN_FRONTEND=noninteractive apt-get \
+            sudo DEBIAN_FRONTEND=noninteractive apt \
               -o DPkg::Lock::Timeout=300 install patch -y
             sudo pip3 install ansible
           fi
@@ -49,9 +49,9 @@
     builders:
       - shell: |
           set +x
-          ssh -T opnfv@172.30.13.92 << EOF
-            sudo apt-get -o DPkg::Lock::Timeout=300 update
-            sudo DEBIAN_FRONTEND=noninteractive apt-get \
+          ssh -T opnfv@172.30.12.84 << EOF
+            sudo apt -o DPkg::Lock::Timeout=300 update
+            sudo DEBIAN_FRONTEND=noninteractive apt \
               -o DPkg::Lock::Timeout=300 install python3-pip docker.io -y
             curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.17.0/kind-linux-amd64
             chmod +x ./kind
@@ -64,7 +64,7 @@
             sudo systemctl daemon-reload
             sudo systemctl restart docker
             if [ $(lsb_release -r -s |cut -d\. -f1) -ge "22" ]; then
-              sudo DEBIAN_FRONTEND=noninteractive apt-get \
+              sudo DEBIAN_FRONTEND=noninteractive apt \
                 -o DPkg::Lock::Timeout=300 install podman -y
               sudo podman ps -aq |xargs sudo podman stop || true
               sudo podman ps -aq |xargs sudo podman rm || true
             sudo rm -rfv /data /tmp/xtesting*
           EOF
           if [ $(lsb_release -r -s |cut -d\. -f1) -ge "24" ]; then
-            sudo DEBIAN_FRONTEND=noninteractive apt-get \
+            sudo DEBIAN_FRONTEND=noninteractive apt \
               -o DPkg::Lock::Timeout=300 install ansible patch -y
           else
-            sudo DEBIAN_FRONTEND=noninteractive apt-get \
+            sudo DEBIAN_FRONTEND=noninteractive apt \
               -o DPkg::Lock::Timeout=300 install patch -y
             sudo pip3 install ansible
           fi
@@ -89,8 +89,8 @@
           esac
           (cd ~/.ansible/roles/collivier.xtesting; patch -p1 < tests/docker_config_json.patch)
           ansible-galaxy collection install -f -r ~/.ansible/roles/collivier.xtesting/requirements.yml
-          sed -i "s/127.0.0.1/172.30.13.92/g" ~/.ansible/roles/collivier.xtesting/tests/{playbook}.yml
-          echo 172.30.13.92 ansible_host=172.30.13.92 ansible_user=opnfv > /tmp/inventory
+          sed -i "s/127.0.0.1/172.30.12.84/g" ~/.ansible/roles/collivier.xtesting/tests/{playbook}.yml
+          echo 172.30.12.84 ansible_host=172.30.12.84 ansible_user=opnfv > /tmp/inventory
           ansible-playbook -i /tmp/inventory -vvvv ~/.ansible/roles/collivier.xtesting/tests/{playbook}.yml
 
 - parameter:
       - last-failure
       - last-duration
     regex: ^xtesting-ci-tests-.*$
+
+- builder:
+    name: xtesting-ci-clean-docker
+    builders:
+      - shell: |
+          set +x
+          sudo apt -o DPkg::Lock::Timeout=300 update
+          sudo DEBIAN_FRONTEND=noninteractive apt \
+            -o DPkg::Lock::Timeout=300 install docker.io -y
+          curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.17.0/kind-linux-amd64
+          chmod +x ./kind
+          sudo mv ./kind /usr/local/bin/kind
+          kind delete clusters xtesting jenkins gitlab || true
+          sudo docker ps -aq |xargs sudo docker stop || true
+          sudo docker ps -aq |xargs sudo docker rm || true
+          sudo docker system prune -f --all || true
+          sudo rm -f /etc/systemd/system/docker.service.d/http-proxy.conf
+          sudo systemctl daemon-reload
+          sudo systemctl restart docker
+
+- builder:
+    name: xtesting-ci-tests-debian-docker
+    builders:
+      - shell: |
+          set +x
+          sudo docker run -v /home/opnfv/.docker/config.json:/root/.docker/config.json \
+            -v /home/opnfv/.docker/config.json:/home/opnfv/.config/helm/registry/config.json \
+            -v /data:/data -v /var/run/docker.sock:/var/run/docker.sock --network host debian:{debian} bash -c "\
+          apt update && DEBIAN_FRONTEND=noninteractive apt \
+            -o DPkg::Lock::Timeout=300 install docker.io vim iproute2 sudo git lsb-release -y && \
+          case {debian} in \
+          buster) \
+            [ -z "$VIRTUAL_ENV" ] && sudo DEBIAN_FRONTEND=noninteractive apt \
+              -o DPkg::Lock::Timeout=300 install python3-pip -y && sudo pip3 install ansible ;; \
+          bullseye) \
+            [ -z "$VIRTUAL_ENV" ] && sudo DEBIAN_FRONTEND=noninteractive apt \
+              -o DPkg::Lock::Timeout=300 install python3-pip -y && sudo pip3 install ansible ;; \
+          *) \
+            [ -z "$VIRTUAL_ENV" ] && sudo DEBIAN_FRONTEND=noninteractive apt \
+              -o DPkg::Lock::Timeout=300 install ansible -y ;; \
+          esac && \
+          rm -rf ~/.ansible/roles/collivier.xtesting && \
+          case {release} in \
+          stable) \
+            ansible-galaxy install -f collivier.xtesting ;; \
+          *) \
+            ansible-galaxy install -f git+https://github.com/collivier/ansible-role-xtesting.git,{release} && \
+            mv ~/.ansible/roles/ansible-role-xtesting ~/.ansible/roles/collivier.xtesting ;; \
+          esac && \
+          ansible-galaxy collection install ansible.posix community.general community.grafana \
+            community.kubernetes community.docker community.postgresql community.crypto && \
+          ansible-playbook -vvvv ~/.ansible/roles/collivier.xtesting/tests/{playbook}.yml"
+
+- job-template:
+    name: 'xtesting-ci-tests-{debian}-{release}-{playbook}'
+    triggers:
+      - timed: '@daily'
+    parameters:
+      - xtesting-ci-node:
+          node: '{node}'
+    properties:
+      - build-blocker:
+          use-build-blocker: true
+          blocking-level: 'NODE'
+          blocking-jobs:
+            - '^xtesting-ci-tests-.*$'
+    builders:
+      - xtesting-ci-clean-docker
+      - xtesting-ci-tests-debian-docker:
+          playbook: '{playbook}'
+          release: '{release}'
+          debian: '{debian}'
+
+- project:
+    name: xtesting-ci-tests-debian
+    playbook:
+      - all
+      - kubernetes0
+    node: xtesting
+    release:
+      - stable
+      - master
+    debian:
+      - bullseye
+      - bookworm
+      - trixie
+      - sid
+    jobs:
+      - 'xtesting-ci-tests-{debian}-{release}-{playbook}'
+
+- builder:
+    name: xtesting-ci-tests-ubuntu-docker
+    builders:
+      - shell: |
+          set +x
+          sudo docker run -v /home/opnfv/.docker/config.json:/root/.docker/config.json \
+            -v /home/opnfv/.docker/config.json:/home/opnfv/.config/helm/registry/config.json \
+            -v /data:/data -v /var/run/docker.sock:/var/run/docker.sock --network host ubuntu:{ubuntu} bash -c "\
+          apt update && DEBIAN_FRONTEND=noninteractive apt \
+            -o DPkg::Lock::Timeout=300 install docker.io vim iproute2 git sudo -y && \
+          case {ubuntu} in \
+          bionic) \
+            [ -z "$VIRTUAL_ENV" ] && sudo DEBIAN_FRONTEND=noninteractive apt \
+              -o DPkg::Lock::Timeout=300 install python3-pip -y && sudo LC_CTYPE=C.UTF-8 pip3 install ansible ;; \
+          focal) \
+            [ -z "$VIRTUAL_ENV" ] && sudo DEBIAN_FRONTEND=noninteractive apt \
+              -o DPkg::Lock::Timeout=300 install python3-pip -y && sudo pip3 install ansible ;; \
+          jammy) \
+            [ -z "$VIRTUAL_ENV" ] && sudo DEBIAN_FRONTEND=noninteractive apt \
+              -o DPkg::Lock::Timeout=300 install python3-pip -y && sudo pip3 install ansible ;; \
+          *) \
+            [ -z "$VIRTUAL_ENV" ] && sudo DEBIAN_FRONTEND=noninteractive apt \
+              -o DPkg::Lock::Timeout=300 install ansible -y ;; \
+          esac && \
+          rm -rf ~/.ansible/roles/collivier.xtesting && \
+          case {release} in \
+          stable) \
+            ansible-galaxy install -f collivier.xtesting ;; \
+          *) \
+            ansible-galaxy install -f git+https://github.com/collivier/ansible-role-xtesting.git,{release} && \
+            mv ~/.ansible/roles/ansible-role-xtesting ~/.ansible/roles/collivier.xtesting ;; \
+          esac && \
+          ansible-galaxy collection install ansible.posix community.general community.grafana \
+            community.kubernetes community.docker community.postgresql community.crypto && \
+          case {ubuntu} in \
+          oracular) \
+            ansible-galaxy collection install -f community.docker ;; \
+          *)  ;; \
+          esac && \
+          ansible-playbook -vvvv ~/.ansible/roles/collivier.xtesting/tests/{playbook}.yml"
+
+- job-template:
+    name: 'xtesting-ci-tests-{ubuntu}-{release}-{playbook}'
+    triggers:
+      - timed: '@daily'
+    parameters:
+      - xtesting-ci-node:
+          node: '{node}'
+    properties:
+      - build-blocker:
+          use-build-blocker: true
+          blocking-level: 'NODE'
+          blocking-jobs:
+            - '^xtesting-ci-tests-.*$'
+    builders:
+      - xtesting-ci-clean-docker
+      - xtesting-ci-tests-ubuntu-docker:
+          playbook: '{playbook}'
+          release: '{release}'
+          ubuntu: '{ubuntu}'
+
+- project:
+    name: xtesting-ci-tests-ubuntu
+    playbook:
+      - all
+      - kubernetes0
+    node: xtesting
+    release:
+      - stable
+      - master
+    ubuntu:
+      - bionic
+      - focal
+      - jammy
+      - noble
+      - oracular
+    jobs:
+      - 'xtesting-ci-tests-{ubuntu}-{release}-{playbook}'
+
+- builder:
+    name: xtesting-ci-tests-alpine-docker
+    builders:
+      - shell: |
+          set +x
+          sudo docker run -v /home/opnfv/.docker/config.json:/root/.docker/config.json \
+            -v /home/opnfv/.docker/config.json:/home/opnfv/.config/helm/registry/config.json \
+            -v /data:/data -v /var/run/docker.sock:/var/run/docker.sock --network host alpine:{alpine} ash -c "\
+          case {alpine} in \
+          *) \
+            [ -z "$VIRTUAL_ENV" ] && apk add ansible git ;; \
+          esac && \
+          rm -rf ~/.ansible/roles/collivier.xtesting && \
+          case {release} in \
+          stable) \
+            ansible-galaxy install -f collivier.xtesting ;; \
+          *) \
+            ansible-galaxy install -f git+https://github.com/collivier/ansible-role-xtesting.git,{release} && \
+            mv ~/.ansible/roles/ansible-role-xtesting ~/.ansible/roles/collivier.xtesting ;; \
+          esac && \
+          ansible-galaxy collection install ansible.posix community.general community.grafana \
+            community.kubernetes community.docker community.postgresql community.crypto && \
+          case {alpine} in \
+          "3.18") \
+            [ -z "$VIRTUAL_ENV" ] && apk add ansible git ;; \
+          "3.19") \
+            [ -z "$VIRTUAL_ENV" ] && apk add ansible git && \
+            ansible-galaxy collection install -f community.docker ;; \
+          "3.20") \
+            [ -z "$VIRTUAL_ENV" ] && apk add ansible git && \
+            ansible-galaxy collection install -f community.docker ;; \
+          *) \
+            [ -z "$VIRTUAL_ENV" ] && apk add ansible git ;; \
+          esac && \
+          ansible-playbook -vvvv ~/.ansible/roles/collivier.xtesting/tests/{playbook}.yml"
+
+- job-template:
+    name: 'xtesting-ci-tests-{alpine}-{release}-{playbook}'
+    triggers:
+      - timed: '@daily'
+    parameters:
+      - xtesting-ci-node:
+          node: '{node}'
+    properties:
+      - build-blocker:
+          use-build-blocker: true
+          blocking-level: 'NODE'
+          blocking-jobs:
+            - '^xtesting-ci-tests-.*$'
+    builders:
+      - xtesting-ci-clean-docker
+      - xtesting-ci-tests-alpine-docker:
+          playbook: '{playbook}'
+          release: '{release}'
+          alpine: '{alpine}'
+
+- project:
+    name: xtesting-ci-tests-alpine
+    playbook:
+      - all
+      - kubernetes0
+    node: xtesting
+    release:
+      - stable
+      - master
+    alpine:
+      - 3.18
+      - 3.19
+      - '3.20'
+      - 3.21
+      - edge
+    jobs:
+      - 'xtesting-ci-tests-{alpine}-{release}-{playbook}'