✖ /opt/atlassian/pipelines/agent/build/application.zip directory doesn't exist.
image: node:latest
pipelines:
default:
- step:
name: Install, Build, and Package
caches:
- node
script:
- npm install
- npx tsc
- apt-get update && apt-get install -y zip
- zip -r application.zip . -x "*.git*" -x "bitbucket-pipelines.yml"
artifacts:
- application.zip
- step:
name: Deploy to AWS Lambda Dev
deployment: development
script:
- pipe: atlassian/aws-s3-deploy:1.6.0
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: $AWS_S3_BUCKET
LOCAL_PATH: "$BITBUCKET_CLONE_DIR/application.zip"
- pipe: atlassian/aws-lambda-deploy:1.11.1
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
FUNCTION_NAME: $AWS_FUNCTION_NAME
COMMAND: 'update'
S3_BUCKET: $AWS_S3_BUCKET
S3_KEY: application.zip
@Lokesh M hi. Thanks for your question
✖ /opt/atlassian/pipelines/agent/build/application.zip directory doesn't exist.
This error points you that you should pass a directory not a file.
According to aws-s3-deploy README:
LOCAL_PATH - Local path to folder to be deployed.
Example:
script: - pipe: atlassian/aws-s3-deploy:1.6.0 variables: AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY AWS_DEFAULT_REGION: 'us-east-1' S3_BUCKET: 'my-bucket-name' LOCAL_PATH: $BITBUCKET_CLONE_DIR EXTRA_ARGS: "--exclude=* --include=application.zip"
Regards, Igor
Hello @Lokesh M and welcome to the Community!
That error message suggests the file application.zip was either not correctly generated in the first step or there were some issues with passing it as an artifact from the first step to the second due to its size.
To confirm whether the file is available in both steps, could you please add a simple ls command in the first and second steps and check for the file's existence?
[...]
- zip -r application.zip . -x "*.git*" -x "bitbucket-pipelines.yml"
- ls -la
[...]
[...]
script:
- ls -la
- pipe: atlassian/aws-s3-deploy:1.6.0
[...]
Once you have a new build with those two commands, feel free to share the output of both of them here so we can assist you further.
Thank you, @Lokesh M !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.