Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ref:
name: mapt
namespace: ci
tag: v0.9.6
grace_period: 15m
grace_period: 2h
resources:
limits:
cpu: "2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,34 @@ if [ -f "${SHARED_DIR}/blob_top_level_folders.txt" ]; then
else
echo "Error: Failed to create blob list file"
exit 1
fi
fi

echo "Finding all .pulumi/locks/ blobs in container ${AZURE_STORAGE_BLOB}..."

# Get unique top-level folders that have .pulumi/locks/
az storage blob list \
--container-name "${AZURE_STORAGE_BLOB}" \
--account-name "${AZURE_STORAGE_ACCOUNT}" \
--account-key "${AZURE_STORAGE_KEY}" \
--output json | \
jq -r '.[].name | select(contains("/.pulumi/locks/")) | split("/.pulumi/locks/")[0]' | \
sort -u > "${SHARED_DIR}/folders_with_locks.txt"

if [ ! -s "${SHARED_DIR}/folders_with_locks.txt" ]; then
echo "No .pulumi/locks/ directories found in container"
exit 0
fi

folder_count=$(wc -l < "${SHARED_DIR}/folders_with_locks.txt")
echo "Found ${folder_count} folders with .pulumi/locks/ to clean"

# Delete all lock blobs in one efficient command
echo "Deleting all .pulumi/locks/ blobs across all folders..."
az storage blob delete-batch \
--source "${AZURE_STORAGE_BLOB}" \
--account-name "${AZURE_STORAGE_ACCOUNT}" \
--account-key "${AZURE_STORAGE_KEY}" \
--pattern "*/.pulumi/locks/*"
cp "${SHARED_DIR}/folders_with_locks.txt" "${ARTIFACT_DIR}/folders_cleaned.txt"

echo "Successfully deleted .pulumi/locks/ from ${folder_count} folders"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ref:
name: mapt
namespace: ci
tag: v0.9.6
grace_period: 15m
grace_period: 2h
resources:
limits:
cpu: "2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,33 @@ if [ -f "${SHARED_DIR}/s3_top_level_folders.txt" ]; then
else
echo "Error: Failed to create S3 object list file"
exit 1
fi
fi

echo "Finding all .pulumi/locks/ directories in S3 bucket ${AWS_S3_BUCKET}..."

# Get unique top-level folders that have .pulumi/locks/
aws s3api list-objects-v2 \
--bucket "${AWS_S3_BUCKET}" \
--output json \
--query 'Contents[?contains(Key, `.pulumi/locks/`)].Key' \
| jq -r '.[]?' \
| sed 's|/\.pulumi/locks/.*||' \
| sort -u > "${SHARED_DIR}/folders_with_locks.txt"

if [ ! -s "${SHARED_DIR}/folders_with_locks.txt" ]; then
echo "No .pulumi/locks/ directories found in bucket"
exit 0
fi

folder_count=$(wc -l < "${SHARED_DIR}/folders_with_locks.txt")
echo "Found ${folder_count} folders with .pulumi/locks/ to clean"

# Delete all lock files in one efficient command
echo "Deleting all .pulumi/locks/ files across all folders..."
aws s3 rm "s3://${AWS_S3_BUCKET}/" \
--recursive \
--exclude "*" \
--include "*/.pulumi/locks/*"
cp "${SHARED_DIR}/folders_with_locks.txt" "${ARTIFACT_DIR}/folders_cleaned.txt"

echo "Successfully deleted .pulumi/locks/ from ${folder_count} folders"