From 94801f52321ae8b49a65dae0b72677000e33759f Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Tue, 26 Sep 2023 15:02:41 +0200 Subject: [PATCH] CI remove files on SMB server if they are not from this month Now we can run cleanup in parallel with SMB import/export tests. Problem could happen near 30/31/1 of month. Signed-off-by: Justin Cinkelj --- .github/workflows/integ-test.yml | 4 +--- tests/integration/cleanup/smb_cleanup.sh | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integ-test.yml b/.github/workflows/integ-test.yml index 8f6964935..8ee787a33 100644 --- a/.github/workflows/integ-test.yml +++ b/.github/workflows/integ-test.yml @@ -357,9 +357,7 @@ jobs: - run: ansible-playbook tests/integration/cleanup/ci_replica_cleanup.yml smb_cleanup: - needs: - - integ - - integ-seq + needs: [] runs-on: [self-hosted2] container: quay.io/justinc1_github/scale_ci_integ:8 defaults: diff --git a/tests/integration/cleanup/smb_cleanup.sh b/tests/integration/cleanup/smb_cleanup.sh index ac47e110a..eb97136f6 100755 --- a/tests/integration/cleanup/smb_cleanup.sh +++ b/tests/integration/cleanup/smb_cleanup.sh @@ -21,7 +21,7 @@ delete_files () { files="$(echo "$list_dir" | head --lines=-2 | tail --lines=+3)" echo "files=$files" - today_date=$(date +'%b:%-d:%Y') + today_date=$(date +'%b:%Y') echo "Todays date: $today_date" while IFS= read -r line @@ -33,7 +33,8 @@ delete_files () { continue fi filename="$(echo "$line" | awk '{print $1}')" - file_date=$(echo "$line" | awk '{print $5":"$6":"$8}') + # file_date=$(echo "$line" | awk '{print $5":"$6":"$8}') # "Apr:27:2020" + file_date=$(echo "$line" | awk '{print $5":"$8}') # "Apr:2020" if [ "$file_date" == "$today_date" ] then echo "Keeping file $filename, timestamp is $file_date"