Yaml linter execution and config improved

Change-Id: Ie4aedfb4f4a76d20f0d0432fe6c3a4665501e167
This commit is contained in:
Sergey Lukjanov 2016-09-16 19:43:50 -07:00
parent 0a998b1dd4
commit 1abcb7293d
7 changed files with 48 additions and 16 deletions

View File

@ -10,10 +10,10 @@ service:
readiness: "true"
liveness: "true"
volumes:
- name: keystone-logs
path: "/var/log/ccp/keystone"
type: host
readOnly: False
- name: keystone-logs
path: "/var/log/ccp/keystone"
type: host
readOnly: False
pre:
- name: chown-logs-dir
command: "sudo /bin/chown keystone:keystone /var/log/ccp/keystone"
@ -65,4 +65,4 @@ files:
content: keystone.conf.j2
wsgi-keystone-conf:
path: /etc/apache2/conf-enabled/wsgi-keystone.conf
content: wsgi-keystone.conf.j2
content: wsgi-keystone.conf.j2

View File

@ -10,10 +10,10 @@ service:
readiness: "true"
liveness: "true"
volumes:
- name: keystone-logs
path: "/var/log/ccp/keystone"
type: host
readOnly: False
- name: keystone-logs
path: "/var/log/ccp/keystone"
type: host
readOnly: False
pre:
- name: chown-logs-dir
command: "sudo /bin/chown keystone:keystone /var/log/ccp/keystone"
@ -65,4 +65,4 @@ files:
content: keystone.conf.j2
wsgi-keystone-conf:
path: /etc/apache2/conf-enabled/wsgi-keystone.conf
content: wsgi-keystone.conf.j2
content: wsgi-keystone.conf.j2

View File

@ -1,3 +1,4 @@
# yamllint disable
service:
name: {{ service_name }}
ports:
@ -65,4 +66,5 @@ files:
content: {{ service_name }}.conf.j2
wsgi-{{ service_name }}-conf:
path: /etc/apache2/conf-enabled/wsgi-{{ service_name }}.conf
content: wsgi-{{ service_name }}.conf.j2
content: wsgi-{{ service_name }}.conf.j2
# yamllint enable

View File

@ -13,8 +13,8 @@ spec:
- containerPort: 5000
hostPort: 5000
readinessProbe:
httpGet:
path: /v2/_catalog
port: 5000
initialDelaySeconds: 3
timeoutSeconds: 1
httpGet:
path: /v2/_catalog
port: 5000
initialDelaySeconds: 3
timeoutSeconds: 1

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

@ -19,6 +19,10 @@ commands =
bash -c "find {toxinidir} -type f -name '*.sh' -not -path '*/.tox/*' -exec bashate -v \{\} \;"
flake8 {posargs}
[testenv:linters]
deps = yamllint
commands = {toxinidir}/tools/yamllint.sh
[testenv:venv]
commands = {posargs}