import-customers
v2.1254.0
Published
Cloud function to import customers from different sources
Downloads
397
Readme
Customers Import
Dependencies
- Node 14
- gcloud cli
Install
- 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 workflow
In your local machine, functions are run individually in tests. They are never run in a local stack.
Launching the web server of one function
There are two http function:
- handleLoadCustomers
- handleImportCustomers
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.
handleLoadCustomers
You 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 steps
Handle http events with sls invoke local
in serverless-google-cloudfunctions to stop using Function Framework