Use same S3 WORM bucket for all builds

This commit is contained in:
Cezar.Leahu
2020-08-25 00:22:19 +03:00
parent 010452eb4d
commit 0cf6e00a22
2 changed files with 6 additions and 1 deletions

View File

@@ -8,6 +8,11 @@ pushd "$(dirname "${BASH_SOURCE[0]}")/../"
pip install awscli
printf "${CREATE_BUCKET_AWS_ACCESS_KEY}\n${CREATE_BUCKET_AWS_SECRET_KEY}\n\n\n" | aws configure
if aws s3 ls | awk '{print $3}' | grep -q "^${S3_BUCKET2_NAME}$" ; then
echo "Bucket ${S3_BUCKET2_NAME} already exists"
exit 0
fi
aws s3api create-bucket --bucket "${S3_BUCKET2_NAME}" --region ${S3_BUCKET_REGION} --object-lock-enabled-for-bucket
aws s3api put-object-lock-configuration \
--bucket "${S3_BUCKET2_NAME}" \