Added YAML file linting
Change-Id: I17208c96610ee13772c44b7d765d3014f0023134
This commit is contained in:
parent
1a1c31b5a7
commit
158768278e
13
.zuul.yaml
13
.zuul.yaml
@ -27,6 +27,8 @@
|
||||
- airship-pegleg-docker-build-gate-ubuntu_xenial
|
||||
- airship-pegleg-docker-build-gate-ubuntu_bionic
|
||||
- airship-pegleg-docker-build-gate-opensuse
|
||||
- airship-pegleg-lint-yaml
|
||||
|
||||
gate:
|
||||
jobs:
|
||||
- openstack-tox-pep8
|
||||
@ -34,6 +36,7 @@
|
||||
- airship-pegleg-docker-build-gate-ubuntu_xenial
|
||||
- airship-pegleg-docker-build-gate-ubuntu_bionic
|
||||
- airship-pegleg-docker-build-gate-opensuse
|
||||
- airship-pegleg-lint-yaml
|
||||
post:
|
||||
jobs:
|
||||
- airship-pegleg-docker-publish-ubuntu_xenial
|
||||
@ -47,6 +50,16 @@
|
||||
- name: primary
|
||||
label: ubuntu-xenial
|
||||
|
||||
- job:
|
||||
name: airship-pegleg-lint-yaml
|
||||
voting: true
|
||||
timeout: 600
|
||||
run: tools/gate/playbooks/lint-yaml.yaml
|
||||
nodeset: ubuntu-bionic
|
||||
irrelevant-files:
|
||||
- ^.*\.rst$
|
||||
- ^doc/.*$
|
||||
|
||||
- job:
|
||||
name: pegleg-dependency-vulnerability-check
|
||||
parent: tox-py36
|
||||
|
@ -100,4 +100,3 @@ required:
|
||||
- name
|
||||
- layeringDefinition
|
||||
- storagePolicy
|
||||
|
||||
|
16
tools/gate/install-yaml-lint.sh
Executable file
16
tools/gate/install-yaml-lint.sh
Executable file
@ -0,0 +1,16 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -xe
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install --no-install-recommends -y yamllint
|
13
tools/gate/lint-yaml.sh
Executable file
13
tools/gate/lint-yaml.sh
Executable file
@ -0,0 +1,13 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
yamllint -c ./tools/gate/playbooks/yamllint-config.yaml .
|
21
tools/gate/playbooks/lint-yaml.yaml
Normal file
21
tools/gate/playbooks/lint-yaml.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- hosts: ubuntu-bionic
|
||||
tasks:
|
||||
- name: lint-yaml
|
||||
shell: |
|
||||
set -xe;
|
||||
./tools/gate/install-yaml-lint.sh
|
||||
./tools/gate/lint-yaml.sh
|
||||
args:
|
||||
chdir: "{{ zuul.projects['opendev.org/airship/pegleg'].src_dir }}"
|
19
tools/gate/playbooks/yamllint-config.yaml
Normal file
19
tools/gate/playbooks/yamllint-config.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
line-length:
|
||||
max: 80
|
||||
level: warning
|
Loading…
Reference in New Issue
Block a user