> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# cngtech/serverless

Jobs for testing, building and deploying serverless apis


## Commands

### cache_node_modules

A common cache saving routine to use across commands


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-key` | string | yarn.lock | File to use as a Node cache checksum. |
| `cache-version` | string | v3 | Cache version; increment this for a fresh cache. |
| `dir` | string | ~/app/node_modules | Filepath to your Node modules. |

### echo

Echo's out a Not Impemented method. This was only added to create a major version of the orb.


### npm

Run an npm command.

This command will first restore a cache of node dependencies, if one was
saved by a previous build. The provided `command` will then be executed, and
if successful, a fresh cache will be saved, if required.

The contents of the `~/project/node_modules` directory is cached, which will substantially
improve build times for projects with many dependencies.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-key` | string | package.json | File to use as a Node cache checksum. |
| `cache-version` | string | v1 | Cache version; increment this for a fresh cache. |
| `command` | string |  | The yarn command to run |
| `dir` | string | ~/project/node_modules | Filepath to your Node modules. |

### openjdk

### yarn

Run a yarn command.

This command will first restore a cache of node dependencies, if one was
saved by a previous build. The provided `command` will then be executed, and
if successful, a fresh cache will be saved, if required.

The contents of the `~/project/node_modules` directory is cached, which will substantially
improve build times for projects with many dependencies.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-key` | string | yarn.lock | File to use as a Node cache checksum. |
| `cache-version` | string | v3 | Cache version; increment this for a fresh cache. |
| `command` | string |  | The yarn command to run (passing no command will do a yarn install) |
| `dir` | string | ~/app/node_modules | Filepath to your Node modules. |
| `lerna-link` | boolean | false | Should we link lerna packages for simultaneous deployment |

## Jobs

### api_key

| Parameter | Type | Default | Description |
|---|---|---|---|
| `environment` | enum | dev | The environment in which the application is deployed |

### check_swagger_types

| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Cache version; increment this for a fresh cache. |
| `node_version` | enum | 20 | Choose your node major version. '12' (current LTS version)
 |

### checkver

### deploy

| Parameter | Type | Default | Description |
|---|---|---|---|
| `environment` | enum | dev | The environment in which to deploy your application |
| `oracle` | boolean | false | If oracle libs should be included |

### deploy_next_js

| Parameter | Type | Default | Description |
|---|---|---|---|
| `environment` | enum | dev | The environment in which to deploy your application |

### deploy_next_js_lts

| Parameter | Type | Default | Description |
|---|---|---|---|
| `environment` | enum | dev | The environment in which to deploy your application |
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |

### deploy_no_global

| Parameter | Type | Default | Description |
|---|---|---|---|
| `environment` | enum | dev | The environment in which to deploy your application |
| `oracle` | boolean | false | If oracle libs should be included |

### deploy_node_12

| Parameter | Type | Default | Description |
|---|---|---|---|
| `environment` | enum | dev | The environment in which to deploy your application |
| `oracle` | boolean | false | If oracle libs should be included |

### deploy_node_lts

| Parameter | Type | Default | Description |
|---|---|---|---|
| `environment` | enum | dev | The environment in which to deploy your application |
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |
| `oracle` | boolean | false | If oracle libs should be included |
| `region` | enum | us-east-1 |  |

### deploy_swagger_types

| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Cache version; increment this for a fresh cache. |
| `node_version` | enum | 20 | Choose your node major version. '20' (current LTS version)
 |

### deploy_with_npm

| Parameter | Type | Default | Description |
|---|---|---|---|
| `environment` | enum | dev | The environment in which to deploy your application |
| `oracle` | boolean | false | If oracle libs should be included |

### deploy_yarn_prod

| Parameter | Type | Default | Description |
|---|---|---|---|
| `environment` | enum | dev | The environment in which to deploy your application |
| `oracle` | boolean | false | If oracle libs should be included |

### gitinfo

### jira

### lint

### lint_lts

| Parameter | Type | Default | Description |
|---|---|---|---|
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |

### notify_wrapper_github

| Parameter | Type | Default | Description |
|---|---|---|---|
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |

### src_clear

### static_build

| Parameter | Type | Default | Description |
|---|---|---|---|
| `artifact-path` | string | build | Path to build artifact, relative to ~/app. |
| `before-build` | steps |  | Steps that will run before the build step |

### static_deploy

| Parameter | Type | Default | Description |
|---|---|---|---|
| `bucket` | string |  | The bucket in which to deploy the static assets |
| `bucket_id` | string |  | The bucket id correlating to the deployment bucket |
| `distribution_id` | string |  | The CloudFront distribution id for cache invalidation |
| `environment` | enum | dev | The environment in which to deploy your application |

### svc_mocks

| Parameter | Type | Default | Description |
|---|---|---|---|
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |

### svc_now

| Parameter | Type | Default | Description |
|---|---|---|---|
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |

### swagger

### swagger_lts

| Parameter | Type | Default | Description |
|---|---|---|---|
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |

### test

| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Cache version; increment this for a fresh cache. |
| `command-string` | string |  | String appended to test command; intended for passing flags. |
| `upload-cc` | boolean | false | Should your project upload to Code Climate |

### test_deployment

| Parameter | Type | Default | Description |
|---|---|---|---|
| `environment` | enum | dev | The environment in which to deploy your application |
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |
| `region` | enum | us-east-1 |  |

### test_lambda

| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Cache version; increment this for a fresh cache. |
| `command-string` | string |  | String appended to test command; intended for passing flags. |
| `upload-cc` | boolean | false | Should your project upload to Code Climate |

### test_lambda_lts

| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Cache version; increment this for a fresh cache. |
| `command-string` | string |  | String appended to test command; intended for passing flags. |
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |
| `upload-cc` | boolean | false | Should your project upload to Code Climate |

### test_lts

| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Cache version; increment this for a fresh cache. |
| `command-string` | string |  | String appended to test command; intended for passing flags. |
| `coverage_glob` | string | src/**/* | The default folder to gather coverage stats
 |
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |
| `upload-cc` | boolean | false | Should your project upload to Code Climate |

### test_mongo

### test_mongo_memory

| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-version` | string | v1 | Cache version; increment this for a fresh cache. |

### test_parallel_lts

Run a yarn test command split over multiple instances.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cache-key` | string | yarn.lock | File to use as a Node cache checksum. |
| `cache-version` | string | v1 | Cache version; increment this for a fresh cache. |
| `dir` | string | ~/app/node_modules | Filepath to your Node modules. |
| `node_version` | enum | 20 | Choose your node major version. '20'
 |
| `parallel_instances` | integer | 4 | the number of instances to split tests across |
| `test_glob` | string | src/**/*.{spec,test}.[jt]s | glob matching tests to run |
| `upload-cc` | boolean | false | Should your project upload to Code Climate |

### upload_parallel_coverage

This will combine the multiple coverage reports output from yarn parallel test runs and upload to code climate.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `upload-cc` | boolean | false | Should your project upload to Code Climate |

## Executors

### checkver

### gitinfo

### mongo

### node

### node_12

### node_lts

| Parameter | Type | Default | Description |
|---|---|---|---|
| `node_version` | enum | 20 | Choose your node major version. '20', '22' or '18' (EOL 2025-09-01)
 |

### python

## Examples

### test_and_deploy

Test, Lint and Deploy a serverless API

```yaml
orbs:
  slack: cngtech/serverless@x.y.z
version: 2.1
workflows:
  your-workflow:
    jobs:
      - serverless/lint
      - serverless/test
      - serverless/checkenv
      - serverless/swagger
      - serverless/deploy:
          context: org-global
          environment: dev
          name: deploy-dev
          requires:
            - serverless/lint
            - serverless/test
            - serverless/checkenv
            - serverless/swagger
      - serverless/deploy:
          context: org-global
          environment: qa
          name: deploy-qa
          requires:
            - serverless/lint
            - serverless/test
            - serverless/checkenv
            - serverless/swagger
```