An open API service indexing awesome lists of open source software.

https://github.com/nhsdigital/eps-cdk-utils


https://github.com/nhsdigital/eps-cdk-utils

Last synced: 4 days ago
JSON representation

Awesome Lists containing this project

README

          

# Electronic Prescription Service CDK Utils

![Build](https://github.com/NHSDigital/eps-cdk-utils/workflows/release/badge.svg?branch=main)

This repository contains a docker image used to deploy CDK to our environments and a CDK constructs library for common EPS project patterns.

- `docker/` Contains Dockerfile used to build image used fo for CDK deployments
- `packages/cdkConstructs/` Contains common CDK constructs used in EPS projects
- `packages/depoymentUtils/` Contains shared code for standardizing OAS files and performing proxygen deployments
- `scripts/` Utilities helpful to developers of this specification
- `.github/` Contains GitHub workflows that are used for building and deploying from pull requests and releases

## Releases
A release of this code happens automatically every Wednesday, but can also be triggered manually by running the release workflow.
The release workflow does the following
- creates a new tagged version
- creates a new version of the cdk construct library and publishes it to github
- pushes the cdk-utils docker image to dev and all other environments (subject to manual release approval in github actions)

## CDK Constructs

This contains common CDK constructs used in EPS projects.

Available constructs are:

- `TypescriptLambdaFunction` - A reusable construct for TypeScript Lambda functions

## Contributing

Contributions to this project are welcome from anyone, providing that they
conform to the [guidelines for contribution](./CONTRIBUTING.md) and the [community code of conduct](./CODE_OF_CONDUCT.md).

### Licensing

This code is dual licensed under the MIT license and the OGL (Open Government
License). Any new work added to this repository must conform to the conditions of
these licenses. In particular this means that this project may not depend on
GPL-licensed or AGPL-licensed libraries, as these would violate the terms of those
libraries' licenses.

The contents of this repository are protected by Crown Copyright (C).

## Development

It is recommended that you use Visual Studio Code and a devcontainer as this
will install all necessary components and correct versions of tools and languages.
See [https://code.visualstudio.com/docs/devcontainers/containers](https://code.visualstudio.com/docs/devcontainers/containers) for details on how to set this up on your host machine.

All commits must be made using [signed commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits).

### Testing changes to construct library
To test changes to the construct library, you need to package the library and install it on the project you want to test it on.

Either
- run `make package` from this project and copy the .tgz file from lib folder to the project you want to test in
- create a pull request and from the pull request workflow run, download nhsdigital-eps-cdk-constructs-1.0.0.tgz to the project you want to test in

In the project you want to test in, run the following

```bash
npm install --save NHSDigital-eps-cdk-constructs-1.0.0.tgz --workspace packages/cdk/
```

You will then be able to use it - for example:

```typescript
import {TypescriptLambdaFunction} from "@NHSDigital/eps-cdk-constructs"
```

### Make Commands

There are `make` commands that are run as part of the CI pipeline and help alias some
functionality during development.

#### Install targets

- `install-node` Installs node dependencies
- `install-python` Installs python dependencies
- `install-hooks` Installs git pre commit hooks
- `install` Runs all install targets

#### Linting and testing

- `lint` Runs lint for all code
- `test` Runs unit tests for all code

#### Compiling

- `compile` Compiles all code
- `package` Creates distributable tarball of CDK constructs

#### Check licenses

- `check-licenses` Checks licenses for all packages used

#### Clean targets

- `clean` Clears up any files that have been generated by building or testing locally
- `deep-clean` Runs clean target and also removes any node_modules and python libraries installed locally