Skip to content

Commit

Permalink
CI remove files on SMB server if they are not from this month
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
justinc1 committed Sep 26, 2023
1 parent 9d05daf commit 94801f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/integ-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/cleanup/smb_cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 94801f5

Please sign in to comment.