diff --git a/.npmignore b/.npmignore index 0c43761..2f2777f 100644 --- a/.npmignore +++ b/.npmignore @@ -24,3 +24,4 @@ package-lock.json renovate.json tsconfig.json yarn-* +yarn.lock \ No newline at end of file diff --git a/README.md b/README.md index a4fe2be..b287b23 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,11 @@ multiple documents per stream or file, inserting defaults, and other magic. ## Usage -To run with Docker (**recommended**): `docker run --rm ssube/salty-dog:master` +`salty-dog` is distributed as a package or container. + +While the container is the preferred way of running `salty-dog`, it has a serious limitation: `docker run` combines +`stdout` and `stderr`, making it impossible to separate logs and the output document. Writing either the logs or dest +to a file works around this. To download, validate, and apply a Kubernetes resource: @@ -35,6 +39,8 @@ ingress.extensions/gitlab created (dry run) ### Docker +To run with Docker: `docker run --rm ssube/salty-dog:master` + The latest semi-stable image is `ssube/salty-dog:master`. All [tags are listed here](https://cloud.docker.com/repository/docker/ssube/salty-dog/tags). diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..156be29 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,49 @@ +# Salty Dog + +Rule-based YAML validator using JSON schemas. + +## Rules + +Rules can be loaded from YAML files or Node modules and [are documented here](./rules.md). + +## Usage + +`salty-dog` is distributed as a package or container. + +While the container is the preferred way of running `salty-dog`, it has a serious limitation: `docker run` combines +`stdout` and `stderr`, making it impossible to separate logs and the output document. Writing either the logs or dest +to a file works around this. + +### Docker + +The `ssube/salty-dog` image can be run once or interactively: + +```shell +> docker pull ssube/salty-dog:master +> docker run --rm ssube/salty-dog:master --help +``` + +#### Interactive + +```shell +> docker run --rm --entrypoint bash ssube/salty-dog:master +``` + +### Node + +The `salty-dog` package can be installed locally (for use in a single project) or globally (as a binary). + +#### Global + +```shell +> yarn global add salty-dog +> export PATH="${PATH}:$(yarn global bin)" +> salty-dog --help +``` + +#### Local + +```shell +> yarn add -D salty-dog +> $(yarn bin)/salty-dog --help +``` diff --git a/yarn.lock b/yarn.lock index 3fdd9e5..ba25c4d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -80,6 +80,11 @@ dependencies: "@types/node" "*" +"@types/sinon@^7.0.13": + version "7.0.13" + resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.0.13.tgz#ca039c23a9e27ebea53e0901ef928ea2a1a6d313" + integrity sha512-d7c/C/+H/knZ3L8/cxhicHUiTDxdgap0b/aNJfsmLwFu/iOP17mdgbQsbHA3SJmrzsjD0l3UEE5SN4xxuz5ung== + "@types/yargs-parser@*": version "13.0.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.0.0.tgz#453743c5bbf9f1bed61d959baab5b06be029b2d0"