I have a scenario whrein I have following folder hierarchy - each folder containing an AWS Lambda to be deployed
root_dir\
\lambda1
\lambda2
Common step (YAML Anchor) is:
definitions:
steps:
- step: &buildAndDeployLambda
name: build image
image:
name: python:3.7.3
caches:
- docker
services:
- docker
script: # build an image
- ls -ltr
- pip3 install awscli
- source ./deployment/config.sh
....
Deployment steps for lambdas are *similar*, with some variable name differences, like the lambda name, etc. I can create a YAML anchor with a common step. As YAML Anchors don't support overriding variables, I circumvented this by adding a config.sh file containing lambda name in each folder, which is sourced as a script in the common step.
I need assistance with two things -
- How to run individual folders so that they can be deployed individually in a manual manner? How will the shared step get the folder name to cd into in the below calls?
pipelines:
custom:
my-lambda-1:
- step: *buildAndDeployLambda
<<:
deployment: dev
name: Deploying Lambda 1
my-lambda-2:
- step: *buildAndDeployLambda
<<:
deployment: dev
name: Deploying Lambda 2
2. How to parallelize the above deployment, so that multiple such folders are deployed using a common step in a parallel manner?
Thanks