Skip to content

Commit 949b1e6

Browse files
authored
add x permissions to providers after download (#2134)
* add x permissions to providers after download * quieter and add failure on exec error
1 parent d9828b0 commit 949b1e6

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

scripts/s3-cache-download.bash

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,24 @@ echo "Ensuring cache directory exists: $CACHE_DIR"
3131

3232
# Download cache from S3
3333
echo "Restoring cache from S3 bucket: $BUCKET (prefix: $PREFIX, region: $REGION)"
34-
if aws s3 sync "s3://$BUCKET/$PREFIX" "$CACHE_DIR" --region "$REGION"; then
34+
if aws s3 sync "s3://$BUCKET/$PREFIX" "$CACHE_DIR" --region "$REGION" --only-show-errors; then
3535
CACHED_FILES=$(find "$CACHE_DIR" -type f 2>/dev/null | wc -l)
3636
echo "Cache restored successfully ($CACHED_FILES files)"
37-
37+
3838
if [ "$CACHED_FILES" -gt 0 ]; then
3939
echo "Sample cached artifacts:"
4040
find "$CACHE_DIR" -type f 2>/dev/null | head -3
4141
fi
42+
43+
# This step is necessary for filesystems where noexec is enabled
44+
echo "Setting permissions for cached artifacts (provider files)"
45+
if find "$CACHE_DIR" -type f -name 'terraform-provider-*' \
46+
-exec chmod +x {} \; ; then
47+
echo "✅ All provider binaries marked executable."
48+
else
49+
echo "❌ Failed to set exec bit on one or more providers." >&2
50+
fi
51+
4252
else
4353
echo "No existing cache found or failed to restore (this is normal for first run)"
4454
fi

scripts/s3-cache-upload.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fi
6767
echo "Saving cache to S3 bucket: $BUCKET (prefix: $PREFIX, region: $REGION)"
6868
echo "Uploading $ARTIFACT_COUNT files"
6969

70-
if aws s3 sync "$CACHE_DIR" "s3://$BUCKET/$PREFIX" --region "$REGION"; then
70+
if aws s3 sync "$CACHE_DIR" "s3://$BUCKET/$PREFIX" --region "$REGION" --only-show-errors; then
7171
echo "Cache saved successfully"
7272
else
7373
echo "Warning: Failed to save cache (this won't fail the build)"

0 commit comments

Comments
 (0)