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?
Check this out from the aws s3 sync help page:
"from the source directory".
This tool is not designed to act on files.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.