From 977ac3328baecc6f8ecf823b0943ac70f099f8a6 Mon Sep 17 00:00:00 2001 From: Michael Hollister Date: Mon, 21 Oct 2024 13:51:00 -0500 Subject: [PATCH] Fix artifact cleanup --- receivers/electron/scripts/deploy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/receivers/electron/scripts/deploy.py b/receivers/electron/scripts/deploy.py index 9f9cd49..ca94e8d 100644 --- a/receivers/electron/scripts/deploy.py +++ b/receivers/electron/scripts/deploy.py @@ -1,3 +1,4 @@ +import glob import os import hashlib import boto3 @@ -63,8 +64,8 @@ def copy_artifacts_to_local_cache(): shutil.copytree('/artifacts', dst, dirs_exist_ok=True, ignore=shutil.ignore_patterns('*.w*')) # Clean up old job artifacts - shutil.rmtree('/artifacts') - os.makedirs('/artifacts', exist_ok=True) + for file in glob.glob(os.path.join('/artifacts', '*')): + os.remove(file) return version def sync_local_cache():