CodeBuild artifact upload to S3 root

0

Hi,
I have a CodeBuild config that almost meets our requirements, except for a tiny detail.
We need the artifacts to be uploaded to the S3 bucket root, not within a folder.

The default behavior to place artifacts in a folder with the same name as the build seems very strong. I have managed to override that by using the 'name' attribute within 'artifacts' but I have found no way to set name to empty string. When doing name: '' the attribute is disregarded.

Is there any way to make CodeBuild upload artifacts to the S3 bucket root?

Thanks,
Thomas Å.

asked 5 years ago894 views
3 Answers
0

Hi takesson,

If you put a . in the name section of the artifacts it will place the artifacts in the root of the s3 bucket.

Let me know if you have any other questions,
John

answered 5 years ago
0

Hi John,

I thought I had tried name: . or name: '.' obviously not because it works fine.

The web console does not fully understand . because the link to S3 includes a . prefix. Not a big deal.

Many thanks for your help,
Thomas Å.

answered 4 years ago
0

Hi,

I'm having the same problem, but in my case the contents are being wrapped in a folder "site/".

I'm not sure where this folder is defined, and I've tried everything but it keeps putting the artifacts in that folder.

Any help will be appreciated!

Thanks,

Amy

EDIT: I solved it by setting both fields in the artefacts config (path, and name) as "."

Edited by: amypellegrini on Feb 11, 2021 1:25 AM

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions