Yaml linter execution and config improved

Change-Id: I29c124f9c84f6d5c7efc77edc7c7a85e75392b15
This commit is contained in:
Sergey Lukjanov 2016-09-16 19:45:55 -07:00
parent 15bcb96925
commit 548ad8ff87
11 changed files with 61 additions and 45 deletions

View File

@ -40,12 +40,11 @@
triggers:
- zuul
- project:
name: fuel-ccp-docs-build-jobs
jobs:
- 'build-all-docs-manual-job-{repo}'
- 'build-all-docs-triggered-job-{repo}'
- 'build-all-docs-manual-job-{repo}'
- 'build-all-docs-triggered-job-{repo}'
repo:
- 'fuel-ccp-specs':
branch: 'master'
- 'fuel-ccp-specs':
branch: 'master'

View File

@ -45,22 +45,22 @@
artifacts: '*'
latest-only: false
- post-tasks:
- matches:
- log-text: ''
escalate-status: true
run-if-job-successful: false
script: |
#!/bin/bash
- matches:
- log-text: ''
escalate-status: true
run-if-job-successful: false
script: |
#!/bin/bash
set -ex
set -ex
export ENV_NAME="env-k8s-kargo-$BUILD_TAG"
export ENV_NAME="env-k8s-kargo-$BUILD_TAG"
source /home/jenkins/venv-fuel-devops-3.0/bin/activate
echo "Running on $NODE_NAME: $ENV_NAME"
source /home/jenkins/venv-fuel-devops-3.0/bin/activate
echo "Running on $NODE_NAME: $ENV_NAME"
dos.py erase $ENV_NAME || true
deactivate
dos.py erase $ENV_NAME || true
deactivate
- job:
name: fuel-ccp-mcp-qa

View File

@ -12,4 +12,3 @@
global: true
triggers:
- zuul

View File

@ -5,19 +5,19 @@
name: mcpinstaller
scm:
- git:
url: 'ssh://nextgen-ci@review.fuel-infra.org:29418/{scm-repo}'
branches:
- '{scm-branch}'
basedir: '{scm-basedir}'
url: 'ssh://nextgen-ci@review.fuel-infra.org:29418/{scm-repo}'
branches:
- '{scm-branch}'
basedir: '{scm-basedir}'
- scm:
name: openstack
scm:
- git:
url: 'https://git.openstack.org/openstack/{scm-repo}.git'
branches:
- '{scm-branch}'
basedir: '{scm-basedir}'
url: 'https://git.openstack.org/openstack/{scm-repo}.git'
branches:
- '{scm-branch}'
basedir: '{scm-basedir}'
- scm:
name: fuel-infra
@ -29,7 +29,6 @@
branches:
- '{scm-branch}'
- scm:
name: zuul_repo
scm:
@ -56,7 +55,6 @@
# Static repositories
#
#
# SSH credentials
#
@ -82,7 +80,7 @@
#
# Publishers
#
#TODO: check target fuel-ccp-ci
# TODO: check target fuel-ccp-ci
- publisher:
name: logs-public
publishers:

View File

@ -63,6 +63,6 @@
- project:
name: Build MCP Docker images and store them into Docker registry.
jobs:
- 'mcp-build-images-latest'
- 'mcp-build-images-build-number'
- 'mcp-clean-docker-registry'
- 'mcp-build-images-latest'
- 'mcp-build-images-build-number'
- 'mcp-clean-docker-registry'

View File

@ -33,13 +33,13 @@
- project:
name: verify-ci-bashate
jobs:
- 'verify-bashate-{repo}'
- 'verify-bashate-{repo}'
repo:
- 'project-config'
- 'project-config'
- project:
name: verify-ci-jjb
jobs:
- 'verify-jjb-{repo}'
- 'verify-jjb-{repo}'
repo:
- 'project-config'
- 'project-config'

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

@ -10,8 +10,10 @@ deps =
usedevelop = False
[testenv:linters]
whitelist_externals =
bash
commands =
{toxinidir}/tools/run-check-yaml-syntax.sh
{toxinidir}/tools/yamllint.sh
# bashate check
bash -c "find {toxinidir} -type f -name '*.sh' -not -path '*/.tox/*' -print0 | xargs -0 bashate -v -iE006"

View File

@ -161,4 +161,3 @@ projects:
periodic:
- 'mcp-build-images-build-number'
- 'mcp-clean-docker-registry'