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

AWS lambda deployment: Error parsing parameter '--zip-file': Unable to load paramfile

Hi , 

I am a newbie to bitbucket pipeline. Trying to configure a pipeline to do the following but getting an error while accessing the zip file in the deployment step saying the file is not found. 

   - Maven build package (which generates a zip file)

   - Deploy the zip file to AWS lambda using the pipe "atlassian/aws-lambda-deploy:0.5.5"

 

bitbucket-pipelines.yml

image: maven:3.6.1

pipelines:
default:
- step:
name: Build
caches:
- maven
script: # Modify the commands below to build your repository.
- # mvn -B verify # -B batch mode makes Maven less verbose
- mvn -DskipTests -B package

- step:
name: Deploy
script:
- pipe: atlassian/aws-lambda-deploy:0.5.5
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: $LAMBDA_FUNCTION_NAME
COMMAND: update
ZIP_FILE: $LAMBDA_ZIP_FILE


Logs:

Maven build log :

INFO] Building zip: /opt/atlassian/pipelines/agent/build/target/csi-stepstone-0.0.1-SNAPSHOT-lambda-package.zip

 

Deployment step log

Error parsing parameter '--zip-file': Unable to load paramfile fileb://opt/atlassian/pipelines/agent/build/target/csi-stepstone-0.0.1-SNAPSHOT-lambda-package.zip: [Errno 2] No such file or directory: 'opt/atlassian/pipelines/agent/build/target/csi-stepstone-0.0.1-SNAPSHOT-lambda-package.zip'
✖ Failed to update Lambda function code.
Searching for files matching artifact pattern .bitbucket/pipelines/generated/pipeline/pipes/**

 

Am I missing anything basic here?

1 answer

1 accepted

2 votes
Answer accepted

This is resolved. 

I added the step for artifact in the maven build and use the artifact in the deploy step. 

 

Below is the final script. 

 

image: maven:3.6.1

pipelines:
default:
- step:
name: Build
caches:
- maven
script: # Modify the commands below to build your repository.
- # mvn -B verify # -B batch mode makes Maven less verbose
- mvn -DskipTests -B package
artifacts:
- target/*

- step:
image:
name: atlassian/default-image:2
name: Sonar Scan
caches:
- maven
script:
- mvn -Dmaven.test.failure.ignore=true -B package # -B batch mode makes Maven less verbose
- mvn sonar:sonar -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.host.url=$SONAR_HOST -Dsonar.login=$SONAR_TOKEN -Dsonar.bitbucket.minSeverity=INFO #Sonar Configuration

- step:
name: Deploy
script:
- pipe: atlassian/aws-lambda-deploy:0.5.5
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: $LAMBDA_FUNCTION_NAME
COMMAND: update
ZIP_FILE: target/$LAMBDA_ZIP_FILE


Suggest an answer

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

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

423 views 13 14
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