Skip to content

Commit

Permalink
Fixes #14 Usage in GitLabCI
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Jun 13, 2020
1 parent f4bddbb commit 8003a00
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ the root of your project where your `.ansible-lint` config file is located.

## Usage

### Command line
```bash
# Single playbook
docker run --rm -v $(pwd):/data cytopia/ansible-lint playbook.yml
Expand All @@ -73,6 +74,26 @@ docker run --rm -v $(pwd):/data cytopia/ansible-lint *.yml
docker run --rm -v "$(pwd)":"/data/$(basename "$(pwd)" )" -e ANSIBLE_ROLES_PATH="/data" cytopia/ansible-lint "/data/$(basename "$(pwd)" )/tests/test.yml"
```

### GitLabCI
GitLabCI requires a shell entrypoint to be specified. See here for details: [Issue #14](https://github.com/cytopia/docker-ansible-lint/issues/14).
```yaml
default:
image:
name: cytopia/ansible-lint:latest
entrypoint: ["/bin/sh", "-c"]

stages:
- lint

ansible-linter:
stage: lint
script:
- ansible-lint *.yaml
only:
- merge_requests
- master
```
## Related [#awesome-ci](https://github.com/topics/awesome-ci) projects
Expand Down

0 comments on commit 8003a00

Please sign in to comment.