CodeClimate
When creating a repository from this template an init
workflow (see here) will run. This workflow uses kaskadi-cli
in order to properly initialize your repository by:
- updating the names refering to the template in relevant files (for example
package.json
,package-lock.json
, etc.) and renaming some files if need be - automatically adding your repository to Code Climate
- automatically setting
REPORTER_ID
secret inside of your repository for test coverage upload to Code Climate. This may fail because of Code Climate infrastructure latency in setting up your repository. In such case your workflow will emit a warning telling you to setREPORTER_ID
manually
mocha
, chai
, nyc
& standard
are available as dev dependencies.
A build
workflow (see here) is running on pull request
and will execute your test suite before allowing you to merge your PR. It also has a coverage
job already prepared that you can comment out as soon as your testing is in place and your REPORTER_ID
is in the repository secrets. This is the ID on Code Climate used for uploading code coverage reports.
Beside running your unit tests, this workflow runs a static code analysis to find any vulnerability in your code. If a vulnerability is found, a notification will appear in the Security
tab of your repository.
The build
workflow also runs a syntax-check
job which checks your serverless.yml
file syntax.
This repository comes with a generate-docs
workflow that generates documentation automatically for you by reading your main serverless.yml
configuration file and extracting meta data of all layers you defined. See here and there for more information.
Before generating the documentation, the workflow will check for syntax error in your serverless.yml
file.
If you would like to see the workflow configuration, head here.
You can configure the template used to generate the action documentation here.
Deploying to AWS is done automatically via a deploy
workflow (see here). This workflow will run on push
. Before publishing it:
- performs a static code analysis of the layer to detect any vulnerabilities. If a vulnerability is found, a notification will appear in the
Security
tab of your repository - checks the syntax of
serverless.yml
for any errors - run any tests you may have set up with
npm test
You'll have to switch the command from --version
to deploy -v
in the workflow configuration file to actually deploy!
Warning: you may need to manually deploy the first time via Serverless
CLI locally.
The following layers are defined in this repository:
No description found for this layer.
custom-utilities
(local utility)
See configuration file for more details.
You can use any tags (and their respective values) visible below to find ressources related to this stack on AWS. See here for more details.
Tag | Value |
---|---|
app | your-app-name |
service | template-kaskadi-layer |
logical-unit | api-logical-unit |
type | s3, sns, etc. |
- Go into
layer/nodejs
(layer
being the path you defined inserverless.yml
configuration file for your layer) - Run
npm i -S <package>
to install any package you need for this layer
You can use the folder called custom-utilities
. This folder will be automatically copied into your layer when you run npm i
. See here for details.
Note: you can rename this folder freely but beware to also update the postinstall
script inside of your layer package.json
file (see here).