fix(ci): clean up older dev/images from S3 bucket before upload to prevent BucketMaxSizeExceeded (#31)
### Summary of Changes - Added automatic cleanup of older images in `dev/images/` before uploading new golden image to prevent S3 bucket storage quota exhaustion.
This commit is contained in:
1 parent
8ae1b85d71
commit
54adb4e081
1 file changed
+2
@@ -125,6 +125,8 @@ jobs:
|
||||
if [ -n "${S3_BUCKET}" ] && [ -n "${AWS_ACCESS_KEY_ID}" ]; then
|
||||
ENDPOINT_FLAG=""
|
||||
[ -n "${S3_ENDPOINT}" ] && ENDPOINT_FLAG="--endpoint-url=${S3_ENDPOINT}"
|
||||
echo "Cleaning up older images in dev/images/ to free bucket storage..."
|
||||
aws ${ENDPOINT_FLAG} s3 rm "s3://${S3_BUCKET}/dev/images/" --recursive || true
|
||||
aws ${ENDPOINT_FLAG} s3 cp "output-qemu/${IMAGE_NAME}" "s3://${S3_BUCKET}/dev/images/${IMAGE_NAME}"
|
||||
echo "Golden image uploaded to s3://${S3_BUCKET}/dev/images/${IMAGE_NAME}"
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user