From 5a5e5cdd745a9505080b410224523e4b937c2bf5 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Fri, 5 Apr 2024 19:00:58 +0900 Subject: [PATCH] cicd: cleanup on scenario fails for redhat --- .github/workflows/advanced-lb-sanity-rh9.yml | 5 ++++- .github/workflows/basic-sanity-rh9.yml | 5 ++++- .github/workflows/ipsec-sanity-rh9.yml | 5 ++++- .github/workflows/liveness-sanity-rh9.yml | 5 ++++- .github/workflows/nat66-sanity-rh9.yml | 5 ++++- .github/workflows/scale-sanity-rh9.yml | 5 ++++- .github/workflows/sctp-sanity-rh9.yml | 5 ++++- .github/workflows/tcp-sanity-rh9.yml | 5 ++++- .github/workflows/udp-sanity-rh9.yml | 5 ++++- 9 files changed, 36 insertions(+), 9 deletions(-) diff --git a/.github/workflows/advanced-lb-sanity-rh9.yml b/.github/workflows/advanced-lb-sanity-rh9.yml index aa2b9c127..6916db650 100644 --- a/.github/workflows/advanced-lb-sanity-rh9.yml +++ b/.github/workflows/advanced-lb-sanity-rh9.yml @@ -80,5 +80,8 @@ jobs: - name: Clean test-bed if: success() || failure() run: | - sudo docker stop $(sudo docker ps -a -q) + xdps=$(sudo docker ps -a -q) + if [[ x$dps != x ]]; then + sudo docker stop $(sudo docker ps -a -q) + fi sudo docker image rm ghcr.io/loxilb-io/loxilb:latest diff --git a/.github/workflows/basic-sanity-rh9.yml b/.github/workflows/basic-sanity-rh9.yml index 9755cbe5e..1dcf2723f 100644 --- a/.github/workflows/basic-sanity-rh9.yml +++ b/.github/workflows/basic-sanity-rh9.yml @@ -36,5 +36,8 @@ jobs: - name: Clean test-bed if: success() || failure() run: | - sudo docker stop $(sudo docker ps -a -q) + xdps=$(sudo docker ps -a -q) + if [[ x$dps != x ]]; then + sudo docker stop $(sudo docker ps -a -q) + fi sudo docker image rm ghcr.io/loxilb-io/loxilb:latest diff --git a/.github/workflows/ipsec-sanity-rh9.yml b/.github/workflows/ipsec-sanity-rh9.yml index fbbed0244..d9aeba30a 100644 --- a/.github/workflows/ipsec-sanity-rh9.yml +++ b/.github/workflows/ipsec-sanity-rh9.yml @@ -45,5 +45,8 @@ jobs: - name: Clean test-bed if: success() || failure() run: | - sudo docker stop $(sudo docker ps -a -q) + xdps=$(sudo docker ps -a -q) + if [[ x$dps != x ]]; then + sudo docker stop $(sudo docker ps -a -q) + fi sudo docker image rm ghcr.io/loxilb-io/loxilb:latest diff --git a/.github/workflows/liveness-sanity-rh9.yml b/.github/workflows/liveness-sanity-rh9.yml index 8b93b4640..9ec3adb34 100644 --- a/.github/workflows/liveness-sanity-rh9.yml +++ b/.github/workflows/liveness-sanity-rh9.yml @@ -68,5 +68,8 @@ jobs: - name: Clean test-bed if: success() || failure() run: | - sudo docker stop $(sudo docker ps -a -q) + xdps=$(sudo docker ps -a -q) + if [[ x$dps != x ]]; then + sudo docker stop $(sudo docker ps -a -q) + fi sudo docker image rm ghcr.io/loxilb-io/loxilb:latest diff --git a/.github/workflows/nat66-sanity-rh9.yml b/.github/workflows/nat66-sanity-rh9.yml index b2842e8aa..f3012032a 100644 --- a/.github/workflows/nat66-sanity-rh9.yml +++ b/.github/workflows/nat66-sanity-rh9.yml @@ -44,5 +44,8 @@ jobs: - name: Clean test-bed if: success() || failure() run: | - sudo docker stop $(sudo docker ps -a -q) + xdps=$(sudo docker ps -a -q) + if [[ x$dps != x ]]; then + sudo docker stop $(sudo docker ps -a -q) + fi sudo docker image rm ghcr.io/loxilb-io/loxilb:latest diff --git a/.github/workflows/scale-sanity-rh9.yml b/.github/workflows/scale-sanity-rh9.yml index 7ae860077..9d32080ad 100644 --- a/.github/workflows/scale-sanity-rh9.yml +++ b/.github/workflows/scale-sanity-rh9.yml @@ -32,5 +32,8 @@ jobs: - name: Clean test-bed if: success() || failure() run: | - sudo docker stop $(sudo docker ps -a -q) + xdps=$(sudo docker ps -a -q) + if [[ x$dps != x ]]; then + sudo docker stop $(sudo docker ps -a -q) + fi sudo docker image rm ghcr.io/loxilb-io/loxilb:latest diff --git a/.github/workflows/sctp-sanity-rh9.yml b/.github/workflows/sctp-sanity-rh9.yml index 9eb475c6b..0b6f5208e 100644 --- a/.github/workflows/sctp-sanity-rh9.yml +++ b/.github/workflows/sctp-sanity-rh9.yml @@ -50,5 +50,8 @@ jobs: - name: Clean test-bed if: success() || failure() run: | - sudo docker stop $(sudo docker ps -a -q) + xdps=$(sudo docker ps -a -q) + if [[ x$dps != x ]]; then + sudo docker stop $(sudo docker ps -a -q) + fi sudo docker image rm ghcr.io/loxilb-io/loxilb:latest diff --git a/.github/workflows/tcp-sanity-rh9.yml b/.github/workflows/tcp-sanity-rh9.yml index 5d23561b7..425232c9f 100644 --- a/.github/workflows/tcp-sanity-rh9.yml +++ b/.github/workflows/tcp-sanity-rh9.yml @@ -62,5 +62,8 @@ jobs: - name: Clean test-bed if: success() || failure() run: | - sudo docker stop $(sudo docker ps -a -q) + xdps=$(sudo docker ps -a -q) + if [[ x$dps != x ]]; then + sudo docker stop $(sudo docker ps -a -q) + fi sudo docker image rm ghcr.io/loxilb-io/loxilb:latest diff --git a/.github/workflows/udp-sanity-rh9.yml b/.github/workflows/udp-sanity-rh9.yml index 08a955248..0180ed569 100644 --- a/.github/workflows/udp-sanity-rh9.yml +++ b/.github/workflows/udp-sanity-rh9.yml @@ -32,5 +32,8 @@ jobs: - name: Clean test-bed if: success() || failure() run: | - sudo docker stop $(sudo docker ps -a -q) + xdps=$(sudo docker ps -a -q) + if [[ x$dps != x ]]; then + sudo docker stop $(sudo docker ps -a -q) + fi sudo docker image rm ghcr.io/loxilb-io/loxilb:latest