Claudia.js with multiple ascetic AWS features
I am using claudia.js CLI to deploy features and web APIs for AWMS gateways and APIs. My project file structure looks like this:
functions
--function1
---- node_modules
---- package.json
---- index.js
---- claudia.json
--function2
---- node_modules
---- package.json
---- index.js
---- claudia.json
The problem is that in order to update to a newer version, I have to run "claudia update" in each functional folder ... so I have to run it once for each function (in each folder). Is there a way to tell claudia.js to update all my functions at once?
source to share
Instead of getting ClaudiaJS to do the job, use the ClaudiaJS launcher tool. Most monorepo tools will suffice, like Lerna , but there is a gamut of less stubborn tools if you don't like what Lerna has to offer - Lolaus is pretty low-level.
With Lerna, you will need to use the prescribed repo structure, link node_modules, and lerna run deploy
will run the npm deploy script of every package that has it.
With Lolaus, you will search for all of your functions and then run an arbitrary command in each directory: lolaus "*/*/caudia.json" claudia update
source to share
We have a lambda repo with multiple repeated lambdas, each in its own subfolder.
> lambdas
> |_lambda1
> |___main.js
> |___main.spec.js
> |___claudia.json
> |___package.json
> |_lambda2
> |___main.js
> |___main.spec.js
> |___claudia.json
> |___package.json
> |_helpers
> |_test.sh
> |_deploy.sh
We use npm and a bash script to iterate over each lambda and run a consistent set of npm / eslint commands. If this goes through the build process, we run the claudia command the same on each lambda. There are several cut and paste folders
source to share