1
0
Fork 0

feat: add rules to image, doc

This commit is contained in:
ssube 2019-06-17 09:11:26 -05:00
parent da4274966a
commit e3588577ac
5 changed files with 24 additions and 15 deletions

View File

@ -1,11 +1,11 @@
FROM node:11-stretch
COPY docs/config-stderr.yml /root/.salty-dog.yml
# copy config and rules, which change rarely
COPY docs/config-docker.yml /root/.salty-dog.yml
COPY rules /rules
# copy package and bundle, which change often
COPY package.json /salty-dog/package.json
COPY out/bundle.js /salty-dog/out/bundle.js
WORKDIR /salty-dog
ENV PATH "${PATH}:/usr/local/lib/node_modules"
ENTRYPOINT [ "node", "/salty-dog/out/bundle.js" ]

View File

@ -8,6 +8,7 @@ Or, as an acronym, JSON **s**chema **a**nalysis, **l**inting, and **t**ransforma
- [SALTY DOG](#salty-dog)
- [Build](#build)
- [Usage](#usage)
- [Docker](#docker)
- [Validate](#validate)
- [Validate File](#validate-file)
- [Validate URL](#validate-url)
@ -57,6 +58,14 @@ ingress.extensions/gitlab created (dry run)
```
### Docker
The Docker container is published for each branch and tag, using the slug (`.` replaced with `-`, mostly). The latest
semi-stable image is `ssube/salty-dog:master`.
Rules are located in `/rules` within the image. To add your own rules, mount them with
`-v ${HOME}/your-rules:/user-rules:ro` and include with `--rules /user-rules/rules.yml`.
### Validate
`salty-dog` can validate JSON and YAML from files and streams, and emit it to a file or stream (with logs going

7
docs/config-docker.yml Normal file
View File

@ -0,0 +1,7 @@
data:
logger:
level: info
name: salty-dog
streams:
- level: info
path: /tmp/salty-dog.log

View File

@ -1,9 +0,0 @@
data:
logger:
level: debug
name: salty-dog
streams:
- level: warn
stream: !stream stderr
- level: debug
path: /tmp/salty-dog-debug.log

View File

@ -17,7 +17,7 @@ const RULE_OPTION: Options = {
type: 'array',
};
const MAIN_ARGS = usage(`Usage: $0 <mode> [options]`)
const MAIN_ARGS = usage(`Usage: salty-dog <mode> [options]`)
.option(CONFIG_ARGS_NAME, {
default: `.${VERSION_INFO.app.name}.yml`,
group: 'Config:',
@ -35,6 +35,7 @@ const MAIN_ARGS = usage(`Usage: $0 <mode> [options]`)
.option('count', {
alias: ['c'],
default: false,
desc: 'Exit with error count',
type: 'boolean',
})
.option('dest', {
@ -56,6 +57,7 @@ const MAIN_ARGS = usage(`Usage: $0 <mode> [options]`)
.option('rules', {
alias: ['r'],
default: [],
desc: 'Rules file',
type: 'array',
})
.option('source', {