Hi,
I try to update my lambda with a bitbucket pipeline. My proyect is built with node and express.
The pipe is built correctly , but lambda does not work. But if I deploy with claudia js in a terminal, I have no problem and the lambda works fine
I think the problem is with de zip file, I'm not sure if params for the zip command are right. The content size of lambda is smaller when is deployed with pipe than is deployed with claudia js. In AWS console, when the pipe is executed, the lambda code is visible and it`s seems right, but when is executed by claudia, code is not visible.
Anyone knows if my pipe code is right to execute an express serverless?
This is my step pipeline yaml file:
- step:
# Build and package the Lambda function.
name: Build and package
script: - apt-get update && apt-get install -y zip
- zip code.zip *
# Upload the Lambda - make the version number
# available to subsequent steps via artifacts.
- pipe: atlassian/aws-lambda-deploy:0.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}
FUNCTION_NAME: 'my-function'
COMMAND: 'update'
ZIP_FILE: 'code.zip'
# Read results from the update pipe into environment variables
- apt-get install -y jq
- BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes"
- VERSION=$(jq --raw-output '.Version' $BITBUCKET_PIPE_SHARED_STORAGE_DIR/aws-lambda-deploy-env)
- pipe: atlassian/aws-lambda-deploy:0.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
FUNCTION_NAME: 'my-function'
COMMAND: 'alias'
ALIAS: 'development'
VERSION: '${VERSION}'
Hi,
I've found my issue. I wasn´t executed npm install command before the pipe.
Now is working.
Thanks!
- step: name: Deploy to test deployment: test # trigger: manual # Uncomment to make this a manual deployment. script: - echo "Deploying to test environment"
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.