Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to loop over step/pipe to be able to update any changed lambdas in the repo

Cord Slatton
Contributor
December 19, 2019

The pipe to update a lambda in AWS takes a single function name, you would have to have a separate step for every lambda in the repo for this to work right. Is there a way to loop a pipe or step, or provide a list of lambda names to be updated?

1 answer

0 votes
t1279k
Contributor
April 15, 2021

did you find how to do it?

Cord Slatton
Contributor
July 21, 2022

No, not with this pipe, for now I just manually loop and do the updates without a pipe.

However, you are allowed to use a pipe within a script, so that might be a way to accomplish this, I haven't had time to investigate that though.

example:


- step: &email-release-complete-dev
        name: Send Completion Email - Dev Release
        condition:
          changesets:
            includePaths:
              - dependencies/**
              - dependencies.json
              - lambda/**/*.py
        script:
          - email=$(git log --format='%ae' ${BITBUCKET_COMMIT}^!)
          - HEADER="#AWS Lambda Deploy to Dev Complete"
          - CONTENT="The pipeline for a merge to the \`dev\` branch for the \`awslambda\` repo has completed. See the attached file \`lambda_to_update.txt\` for a list of effected lambdas."
          - BUILD_LINK="[Pipeline Execution ${BITBUCKET_BUILD_NUMBER}](${BB_LINK}/addon/pipelines/home#!/results/${BITBUCKET_BUILD_NUMBER})"
          - printf "$HEADER\n\n$CONTENT\n\n$BUILD_LINK" | docker run -i datafolklabs/markdown > email_body.html
          - pipe: atlassian/email-notify:0.6.0

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events