Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

CD on AWS S3: Copying build/ folder

I am using a documentation generator that behind uses react. To generate the documentation I do the following steps:

"yarn install"

"yarn build"

Then i get a folder called build/ with all static content. I would like to send this static content inside this folder into a S3 bucket.

I read aws S3 pipeline yml file, but how, before I send the folder I build it? (with the yarn commands)?

I was thinking something like:

a) Get contents from my repo

b) yarn install

c) yarn build

If everything went ok:

d) Get files inside build/ and copy to S3

Can anyone help me create this pipeline file?

 

1 answer

0 votes

Hi @Lara Dias Vasconcelos ,

Thank you for your question!

After build step your pipeline should create build artifacts, so the next step could use them to deploy to AWS S3 bucket.

You could use and extend this pipeline:

image: node:10.15.3

# Workflow Configuration

pipelines:
default:
- step:
name: Build and Test
caches:
- node
script:
- yarn install
# CI=true in default variables for Bitbucket Pipelines https://support.atlassian.com/bitbucket-cloud/docs/variables-in-pipelines/
- yarn test
- yarn run build
artifacts:
- build/**
- step:
name: Deploy to Production
deployment: Production
clone:
enabled: false
script:
# sync your files to S3
- pipe: atlassian/aws-s3-deploy:0.4.5
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
S3_BUCKET: 'my-bucket-name'
LOCAL_PATH: 'build'

But before, please, make sure that node image is right for your build environment or modify it.

More details you could find in the Configure bitbucket-pipelines.yml guide and in the repository with Template react deploy.

Cheers,
Oleksandr

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

148 views 2 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you