test/cases: tag aws s3 resources

all resources on aws originated from a test should be tagged with
"gitlab-ci-test". this commit ensures s3 resources get tagged.
This commit is contained in:
Juan Abia 2021-11-12 10:36:37 +01:00 committed by jrusz
parent c6c311cc3d
commit eed20916b0

View file

@ -895,6 +895,15 @@ function verifyInAWSS3() {
local S3_URL
S3_URL=$(echo "$UPLOAD_OPTIONS" | jq -r '.url')
# Tag the resource as a test file
local S3_FILENAME
S3_FILENAME=$(echo "${S3_URL}" | grep -oP '(?<=/)[^/]+(?=\?)')
$AWS_CMD s3api put-object-tagging \
--bucket "${AWS_BUCKET}" \
--key "${S3_FILENAME}" \
--tagging '{"TagSet": [{ "Key": "gitlab-ci-test", "Value": "true" }]}'
# Download the commit using the Presigned URL
curl "${S3_URL}" --output "${WORKDIR}/edge-commit.tar"