Skip to content

Commit

Permalink
Merge 2e3408d into 845faf1
Browse files Browse the repository at this point in the history
  • Loading branch information
wi1dcard committed Feb 27, 2019
2 parents 845faf1 + 2e3408d commit 3c39d80
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .dockerignore
@@ -0,0 +1,12 @@
node_modules
lib

Dockerfile
logo.png

**/.DS_STORE
**/.git*

coverage
__tests__
tests
12 changes: 12 additions & 0 deletions Dockerfile
@@ -0,0 +1,12 @@
FROM node:current-alpine

WORKDIR /usr/local/lint-md

COPY . .

RUN set -x \
&& npm install \
&& npm run-script build \
&& ln -s ../lint-md/bin/index.js /usr/local/bin/lint-md

CMD ["lint-md"]
34 changes: 34 additions & 0 deletions README.md
Expand Up @@ -147,6 +147,40 @@ script: lint-md README.md



## 基于 Docker

本地使用 Docker 镜像:

```bash
docker run --rm -it yuque/lint-md lint-md README.md Document.md # 也可直接带其它参数
```

另外,在基于 Docker 的 CI/CD 平台上,可使用 `yuque/lint-md` 镜像。例如 GitLab CI/CD:

```yml
lint:
image: yuque/lint-md
script:
- lint-md README.md # 或其它文件
```

Circle CI:

```yml
version: 2
jobs:
lint:
docker:
- image: yuque/lint-md
steps:
- checkout
- run: lint-md README.md # 或其它文件
```

利用 Docker 作为 CI 的基础环境通常更有优势,不必每次构建都执行 `npm install`;资源节省,速度也会更快些。



## API 调用

```js
Expand Down
Empty file modified bin/index.js 100644 → 100755
Empty file.

0 comments on commit 3c39d80

Please sign in to comment.