rel-engage v1.0.1
rel-engage
Standardised tools for the reliability engineering team. Name likely to change
This is very much a work in progress and breaking changes should be expected. Adopt with care.
A few ideas for what could go in here
- a very basic, self-installing makefile (like n-gage, but with less stuff)
- installs linting configs and runtimes ✓
- custom linting for things we care about e.g. may want to enforce consistent patterns in serverless.yaml
- do-exclusively.sh
- example circle, serverless & terraform configs (maybe extending to scaffolding tools to generate ones for new projects)
- some kind of test harnessing
- integration with vault
- secret-squirrel (in fact, let's create av2 of secret squirrel - lots of issues created on it)
- shared cert generator
- code coverage
Installation
npx @financial-times/rel-engage
This will install rel-engage
in your repository, as well as running make install
to generate a Makefile
and several config files. These should be comitted - the config files are references to more flexible config found in this package, and shouldn't need direct modification in future, so are safe to commit.
Usage
The installation step will install a base Makefile
to the repository.
This give access to a number of commands.
To view the available commands, and usage instructions, run
make help
Configuration
Bootstrapping with rel-engage adds a selection of configuration files to your repository:
- editorconfig (
.editorconfig
) - editor setting configuration - eslint (
.eslintrc.js
,.eslintignore
) - javascript linter - husky (
.huskyrc.js
) - git hook configuration - lint-staged (
.lintstagedrc.js
) - commands to run on staged files, defined per file extension - prettier (
.prettierrc.js
,.prettierignore
) - javascript code formatter
These configs link to shared configurations, and do not contain any rules themselves. They should rarely need to be overriden. Some configs allow specific flags to override configuration, see below.
In the case where you do wish to override them, and there are no specific flags in rel-engage
to do so, it's possible to directly modify the configuration, either by using the built in support for the tool (e.g eslint
supports extends
), or by manually extending the javascript object the configuration imports.
Eslint
Eslint can be configured by adding properties to package.json
:
{
"rel-engage": {
"eslint": {
"esModules": true // Enable Ecmascript Modules syntax (impliedStrict, import/export),
"prettier": false // Enable prettier formatting via eslint
}
}
}
Bootstrapping
As a work in progress, this project intends to make it easy to bootstrap different kinds of application. This may be moved out of this package at some point in future.
Serverless
make bootstrap-serverless
This will create a serverless.yaml
file, which reads a number of properties from your package.json
file to populate variables.
This will also output two example IAM templates: an IAM user and an IAM role. These can be added to your accounts AWS Composer repository. _Note: it may be desirable to modify the user to be shared across different serverless projects within the same namespace in order to minimise IAM access key rotation. If this is desired, change the code in the user template to a prefix, e.g. dewey-*
, then use dewey-$sub-name
as each project's system code, i.e. dewey-runbooks
.