A Node.js starter that adds ES7 async/await, serverless-offline, environment variables, and unit test support. Part of the Kubernetes CI/CD pipeline stack.
- ES7 syntax in your handler functions
- Use async/await
- And much more!
- Support for Jest unit tests
- Run
npm testto run your tests
- Run
- Sourcemaps for proper error messages
- Error message show the correct line numbers
- Add environment variables for your stages
- clone repo
npm i
There are two main branches, consistent with other lambda projects by RW. Development work should be done on feature branches off develop, with PRs opened to merge into develop and PRs to master for releases intended to go to production.
| Branch | Build | Description |
|---|---|---|
master |
Deployed to production on succesful build | |
develop |
Deployed to development on successful build |
- Node.js - Node.js 8 LTS
- Jest - Node.js Unit test
- Eslint - Node.js Syntax lint
- Prettier - Node.js Code formatter
- Drone - CI/CD pipeline
- Kubernetes - Infrastructure Stack
- Helm - Kubernetes Package Manager
$ drone secret add \
-repository nchowinf/k8s_node_starter \
-name NPM_TOKEN \
-image plugins/gcr \
-value 'XXXXXXXX'$ drone secret add \
-repository nchowinf/k8s_node_starter \
-name slack_webhook \
-image plugins/slack \
-value 'https://hooks.slack.com/services/XXXXXX'$ drone registry add \
--repository nchowinf/k8s_node_starter \
--hostname gcr.io \
--username _json_key \
--password @/absolute/path/to/keyfile.json
$ drone secret add \
-repository nchowinf/k8s_node_starter \
-name google_credentials \
-image plugins/gcr \
-value @/absolute/path/to/keyfile.json$ docker build \
-t gcr.io/rw-k8s/node-starter:1.0.0 \
--build-arg NPM_TOKEN='test_token' \
--no-cache .$ docker run -p 3000:3000 rw-k8s/node-starter:1.0.0