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

Unable to deploy a Vue app to s3 butcket

Edited

Hello,

I have enabled pipeline in our frontend repo to sync to S3 bucket, the upload works fine when using the root path as you can see below but when using the folder that I need to sync don't find it.

image: node:10.15.3
pipelines:
default:
-
step:
caches:
-
node
script: # Modify the commands below to build your repository.
-
npm install
-
npm run build
artifacts: # defining the artifacts to be passed to each future step.
- dist/**

-
step:
name: Push to S3
trigger: manual
deployment: Production
script:
-
pipe: atlassian/aws-s3-deploy:0.3.2
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: "S3-bucket"
LOCAL_PATH: "./dist/*"

- pipe: atlassian/aws-cloudfront-invalidate:0.3.2
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
DISTRIBUTION_ID: "DIST-ID"

Using LOCAL_PATH: "./" -> work but copy the whole repo and I need the content inside the build "dist" folder.

...

--env=LOCAL_PATH="./" \
--env=S3_BUCKET="S3-bucket" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/aws-s3-deploy:0.3.2

...
upload: dist/android-chrome-192x192.png to s3://S3-bucket/dist/android-chrome-192x192.png
Completed 1.2 MiB/~7.4 MiB (2.2 MiB/s) with ~93 file(s) remaining (calculating...)
Completed 1.5 MiB/~7.5 MiB (2.6 MiB/s) with ~94 file(s) remaining (calculating...)
Completed 1.5 MiB/~7.7 MiB (2.6 MiB/s) with ~97 file(s) remaining (calculating...)
Completed 1.5 MiB/~7.7 MiB (2.6 MiB/s) with ~97 file(s) remaining (calculating...)
upload: dist/android-icon-144x144.png to s3://S3-bucket/dist/android-icon-144x144.png
Completed 1.5 MiB/~7.7 MiB (2.6 MiB/s) with ~96 file(s) remaining (calculating...)
upload: dist/android-chrome-512x512.png to s3://S3-bucket/dist/android-chrome-512x512.png
Completed 1.5 MiB/~7.7 MiB (2.6 MiB/s) with ~96 file(s) remaining (calculating...)
Completed 1.6 MiB/~7.7 MiB (2.6 MiB/s) with ~96 file(s) remaining (calculating...)
upload: dist/android-icon-192x192.png to s3://S3-bucket/dist/android-icon-192x192.png
Completed 1.6 MiB/~7.7 MiB (2.6 MiB/s) with ~95 file(s) remaining (calculating...)
Completed 1.6 MiB/~7.8 MiB (2.5 MiB/s) with ~97 file(s) remaining (calculating...)
Completed 1.6 MiB/~7.8 MiB (2.5 MiB/s) with ~98 file(s) remaining (calculating...)
...
✔ Deployment successful.

but since I only need to upload the content inside the dist/* folder since is a vuejs spa and when I update the local_path to that specific folder doesn't found it as you can see below.

...
--env=LOCAL_PATH="./dist/*" \
--env=S3_BUCKET="S3-bucket" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/aws-s3-deploy:0.3.2

...
✖ ./dist/* directory doesn't exist.

OR

...
--env=LOCAL_PATH="dist/*" \
--env=S3_BUCKET="S3-bucket" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/aws-s3-deploy:0.3.2

...
✖ dist/* directory doesn't exist.

 

Any help will be appreciated that can guide me in the right direction?

1 answer

Check this out from the aws s3 sync help page:

Capture.PNG

"from the source directory".

This tool is not designed to act on files. 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,826 views 10 16
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