Yaml linter execution and config improved

Change-Id: Ib74d2bdcf4cd46414c3f28e75dd07e0c14a625d6
This commit is contained in:
Sergey Lukjanov 2016-09-16 19:47:21 -07:00
parent 3258780211
commit b7b06980b0
5 changed files with 35 additions and 16 deletions

View File

@ -9,10 +9,10 @@ service:
readiness: /opt/ccp/bin/mariadb-readiness.sh
liveness: "true"
volumes:
- name: mysql-logs
path: "/var/log/ccp/mysql"
type: host
readOnly: False
- name: mysql-logs
path: "/var/log/ccp/mysql"
type: host
readOnly: False
pre:
- name: chown-logs-dir
command: "sudo /bin/chown mysql:mysql /var/log/ccp/mysql"
@ -21,10 +21,10 @@ service:
daemon:
command: mysqld
files:
- mariadb-my-cnf
- mariadb-readiness
- mariadb-bootstrap
- mariadb-security-reset.expect
- mariadb-my-cnf
- mariadb-readiness
- mariadb-bootstrap
- mariadb-security-reset.expect
files:
mariadb-my-cnf:
path: /etc/mysql/my.cnf

View File

@ -1,7 +0,0 @@
#!/bin/bash
### Temp yaml syntax checker script.
set -e
for file in $(find . -name '*.yaml'); do
yamllint -d relaxed $file
done

5
tools/yamllint.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
set -ex
workdir=$(dirname $0)
yamllint -c $workdir/yamllint.yaml $(find . -not -path '*/\.*' -type f -name '*.yaml')

21
tools/yamllint.yaml Normal file
View File

@ -0,0 +1,21 @@
extends: default
rules:
braces:
max-spaces-inside: 1
comments:
level: error
comments-indentation:
level: warning
document-end:
present: no
document-start:
level: error
present: no
empty-lines:
max: 1
max-start: 0
max-end: 0
line-length:
level: warning
max: 120

View File

@ -6,4 +6,4 @@ skipsdist = True
[testenv:linters]
deps = yamllint
commands =
{toxinidir}/tools/run-check-yaml-syntax.sh
{toxinidir}/tools/yamllint.sh