- Node 14
- gcloud cli
- Install node dependencies
yarn lerna bootstrap
- Authenticate with Google Default Credential
gcloud auth application-default login
Your user will be used to deploy the serverless stack, you must have at least the following roles on the targeted project:
- Deployment Manager Editor
- Storage Admin
- Logging Admin
- Cloud Functions Developer
- copy .env.template
- replace variables from vault dev/import-customers
Development workflowIn your local machine, functions are run individually in tests. They are never run in a local stack.
Launching the web server of one functionThere are two http function:
To launch a web server and interact with one of this function, just do:
$ yarn start:handleLoadCustomers # Or to watch $ yarn watch:handleLoadCustomers #OR $ yarn start:handleImportCustomers # Or to watch $ yarn watch:handleImportCustomers
Then you can interract with them.
handleLoadCustomersYou can use curl:
$ curl localhost:8080/?executionDate=2022-02-04
The execution date should be the same day for Badge files and the next day for RH files.
Next stepsHandle http events with
sls invoke localin serverless-google-cloudfunctions to stop using Function Framework