Skip to content

Commit

Permalink
feat: add rules to image, doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jun 17, 2019
1 parent da42749 commit e358857
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
@@ -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" ]
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions docs/config-docker.yml
@@ -0,0 +1,7 @@
data:
logger:
level: info
name: salty-dog
streams:
- level: info
path: /tmp/salty-dog.log
9 changes: 0 additions & 9 deletions docs/config-tmp.yml

This file was deleted.

4 changes: 3 additions & 1 deletion src/index.ts
Expand Up @@ -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:',
Expand All @@ -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', {
Expand All @@ -56,6 +57,7 @@ const MAIN_ARGS = usage(`Usage: $0 <mode> [options]`)
.option('rules', {
alias: ['r'],
default: [],
desc: 'Rules file',
type: 'array',
})
.option('source', {
Expand Down

0 comments on commit e358857

Please sign in to comment.