mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
fix(cache): trim whitespace in delta count + use s3api for tagging
Two fixes: 1. Restore: Trim whitespace from DELTA_COUNT to fix integer comparison 2. Save: Use 's3api put-object' instead of 's3 cp' to support --tagging The aws s3 cp command doesn't support --tagging parameter. Switched to s3api put-object which supports tagging directly. Tags are needed for lifecycle policies (30-day eviction).
This commit is contained in:
@@ -107,6 +107,7 @@ runs:
|
||||
# Delete all delta layers for this key
|
||||
echo "Deleting all delta layers matching: ${CACHE_KEY}-delta-*"
|
||||
DELTA_COUNT=$(aws s3 ls "s3://${S3_BUCKET}/" --region "${S3_REGION}" | grep "${CACHE_KEY}-delta-" | wc -l || echo "0")
|
||||
DELTA_COUNT=$(echo "${DELTA_COUNT}" | tr -d ' \n') # Trim whitespace
|
||||
if [ "${DELTA_COUNT}" -gt 0 ]; then
|
||||
aws s3 rm "s3://${S3_BUCKET}/" --recursive \
|
||||
--exclude "*" \
|
||||
|
||||
Reference in New Issue
Block a user