|
1 | | -# eps-cdk-utils |
| 1 | +# Electronic Prescription Service CDK Utils |
2 | 2 |
|
3 | | -This contains a docker image used to deploy cdk to our environments and a cdk-constructs library |
| 3 | + |
4 | 4 |
|
5 | | -# cdk-constructs |
| 5 | +This repository contains a docker image used to deploy CDK to our environments and a CDK constructs library for common EPS project patterns. |
6 | 6 |
|
7 | | -This contains common cdk constructs used in eps projects |
| 7 | +- `docker/` Contains Dockerfile used to build image used fo for CDK deployments |
| 8 | +- `packages/cdkConstructs/` Contains common CDK constructs used in EPS projects |
| 9 | +- `scripts/` Utilities helpful to developers of this specification |
| 10 | +- `.github/` Contains GitHub workflows that are used for building and deploying from pull requests and releases |
8 | 11 |
|
9 | | -Available constructs are |
| 12 | +## CDK Constructs |
10 | 13 |
|
11 | | -- TypescriptLambdaFunction |
| 14 | +This contains common CDK constructs used in EPS projects. |
12 | 15 |
|
13 | | -# development |
| 16 | +Available constructs are: |
14 | 17 |
|
15 | | -If you want to test a new construct, add it to packages/cdkConstructs |
16 | | -Run the following to produce a distributable tarball |
17 | | -``` |
| 18 | +- `TypescriptLambdaFunction` - A reusable construct for TypeScript Lambda functions |
| 19 | + |
| 20 | +## Contributing |
| 21 | + |
| 22 | +Contributions to this project are welcome from anyone, providing that they |
| 23 | +conform to the [guidelines for contribution](./CONTRIBUTING.md) and the [community code of conduct](./CODE_OF_CONDUCT.md). |
| 24 | + |
| 25 | +### Licensing |
| 26 | + |
| 27 | +This code is dual licensed under the MIT license and the OGL (Open Government |
| 28 | +License). Any new work added to this repository must conform to the conditions of |
| 29 | +these licenses. In particular this means that this project may not depend on |
| 30 | +GPL-licensed or AGPL-licensed libraries, as these would violate the terms of those |
| 31 | +libraries' licenses. |
| 32 | + |
| 33 | +The contents of this repository are protected by Crown Copyright (C). |
| 34 | + |
| 35 | +## Development |
| 36 | + |
| 37 | +It is recommended that you use Visual Studio Code and a devcontainer as this |
| 38 | +will install all necessary components and correct versions of tools and languages. |
| 39 | +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. |
| 40 | + |
| 41 | +All commits must be made using [signed commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). |
| 42 | + |
| 43 | +### Setup |
| 44 | + |
| 45 | +If you want to test a new construct, add it to `packages/cdkConstructs`. |
| 46 | + |
| 47 | +### Testing New Constructs |
| 48 | + |
| 49 | +Run the following to produce a distributable tarball: |
| 50 | + |
| 51 | +```bash |
18 | 52 | make package |
19 | 53 | ``` |
20 | | -This will produce a tarball file in lib folder |
21 | 54 |
|
22 | | -Copy this to the project you want to use it in and use the following to install it |
| 55 | +This will produce a tarball file in the `lib` folder. |
23 | 56 |
|
24 | | -``` |
25 | | -npm install --save NHSDigital-eps-cdk-constructs-1.0.0.tgz --workspace packages/cdk/ |
26 | | -``` |
| 57 | +Copy this to the project you want to use it in and use the following to install it: |
27 | 58 |
|
28 | | -You will then be able to use it - eg |
| 59 | +```bash |
| 60 | +npm install --save NHSDigital-eps-cdk-constructs-1.0.0.tgz --workspace packages/cdk/ |
29 | 61 | ``` |
| 62 | + |
| 63 | +You will then be able to use it - for example: |
| 64 | + |
| 65 | +```typescript |
30 | 66 | import {TypescriptLambdaFunction} from "@NHSDigital/eps-cdk-constructs" |
31 | 67 | ``` |
| 68 | + |
| 69 | +### Make Commands |
| 70 | + |
| 71 | +There are `make` commands that are run as part of the CI pipeline and help alias some |
| 72 | +functionality during development. |
| 73 | + |
| 74 | +#### Install targets |
| 75 | + |
| 76 | +- `install-node` Installs node dependencies |
| 77 | +- `install-python` Installs python dependencies |
| 78 | +- `install-hooks` Installs git pre commit hooks |
| 79 | +- `install` Runs all install targets |
| 80 | + |
| 81 | +#### Linting and testing |
| 82 | + |
| 83 | +- `lint` Runs lint for all code |
| 84 | +- `test` Runs unit tests for all code |
| 85 | + |
| 86 | +#### Compiling |
| 87 | + |
| 88 | +- `compile` Compiles all code |
| 89 | +- `package` Creates distributable tarball of CDK constructs |
| 90 | + |
| 91 | +#### Check licenses |
| 92 | + |
| 93 | +- `check-licenses` Checks licenses for all packages used |
| 94 | + |
| 95 | +#### Clean targets |
| 96 | + |
| 97 | +- `clean` Clears up any files that have been generated by building or testing locally |
| 98 | +- `deep-clean` Runs clean target and also removes any node_modules and python libraries installed locally |
0 commit comments