Browse Source

zuul: Add site linting gates

With the integration of the airskiff site in Treasuremap, there is a
need for Zuul site linting gates to ensure that all sites are still
syntactically valid when changes are made to global documents. This
change introduces linting gates for both treasuremap sites, airskiff and
airship-seaworthy.

Story: 2004349
Change-Id: I69dc68bf49b02543f8a2def5841dae7cb5824bd6
tags/v18.12.03
Drew Walters 1 year ago
parent
commit
ad01c813a0
6 changed files with 170 additions and 0 deletions
  1. +42
    -0
      .zuul.yaml
  2. +26
    -0
      tools/gate/lint-site.sh
  3. +23
    -0
      tools/gate/playbooks/airship-seaworthy-site-lint.yaml
  4. +23
    -0
      tools/gate/playbooks/airskiff-site-lint.yaml
  5. +26
    -0
      tools/gate/playbooks/git-config.yaml
  6. +30
    -0
      tools/gate/playbooks/install-docker.yaml

+ 42
- 0
.zuul.yaml View File

@@ -15,3 +15,45 @@
- docs-on-readthedocs
vars:
rtd_webhook_id: '47687'
check:
jobs:
- airship-seaworthy-site-lint-gate
- airskiff-site-lint-gate
gate:
jobs:
- airship-seaworthy-site-lint-gate
- airskiff-site-lint-gate

- nodeset:
name: airship-treasuremap-single-node
nodes:
- name: primary
label: ubuntu-xenial

- job:
name: airship-seaworthy-site-lint-gate
nodeset: airship-treasuremap-single-node
timeout: 900
pre-run:
- tools/gate/playbooks/install-docker.yaml
- tools/gate/playbooks/git-config.yaml
run: tools/gate/playbooks/airship-seaworthy-site-lint.yaml
required-projects:
- openstack/airship-pegleg
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$

- job:
name: airskiff-site-lint-gate
nodeset: airship-treasuremap-single-node
timeout: 900
pre-run:
- tools/gate/playbooks/install-docker.yaml
- tools/gate/playbooks/git-config.yaml
run: tools/gate/playbooks/airskiff-site-lint.yaml
required-projects:
- openstack/airship-pegleg
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$

+ 26
- 0
tools/gate/lint-site.sh View File

@@ -0,0 +1,26 @@
#!/bin/bash

# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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

: "${PEGLEG_PATH:=../airship-pegleg}"
: "${PEGLEG_IMG:=quay.io/airshipit/pegleg:b7556bd89e99f2a6539e97d5a4ac6738751b9c55}"

: "${PEGLEG:=${PEGLEG_PATH}/tools/pegleg.sh}"

# TODO(drewwalters96): make Treasuremap sites P001 and P009 compliant.
IMAGE=${PEGLEG_IMG} TERM_OPTS=" " \
${PEGLEG} site -r . lint "$1" -x P001 -x P009

+ 23
- 0
tools/gate/playbooks/airship-seaworthy-site-lint.yaml View File

@@ -0,0 +1,23 @@
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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: primary
tasks:
- name: Lint airship-seaworthy site
shell: |
set -xe;
./tools/gate/lint-site.sh airship-seaworthy
args:
chdir: "{{ zuul.project.src_dir }}"
become: yes

+ 23
- 0
tools/gate/playbooks/airskiff-site-lint.yaml View File

@@ -0,0 +1,23 @@
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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: primary
tasks:
- name: Lint airskiff site
shell: |
set -xe;
./tools/gate/lint-site.sh airskiff
args:
chdir: "{{ zuul.project.src_dir }}"
become: yes

+ 26
- 0
tools/gate/playbooks/git-config.yaml View File

@@ -0,0 +1,26 @@
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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: primary
tasks:
- name: Git config
shell: |
set -xe;

tee .git/config << EOF
[remote "origin"]
url = https://git.openstack.org/openstack/airship-treasuremap.git
EOF
args:
chdir: "{{ zuul.project.src_dir }}"

+ 30
- 0
tools/gate/playbooks/install-docker.yaml View File

@@ -0,0 +1,30 @@
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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: primary
tasks:
- name: Install Docker CE
shell: |
set -xe;

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-add-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

sudo apt-get update
sudo apt-get install --no-install-recommends -y docker-ce
args:
chdir: "{{ zuul.project.src_dir }}"

Loading…
Cancel
Save