Merge "zuul: Add site linting gates"

This commit is contained in:
Zuul 2018-11-27 18:38:59 +00:00 committed by Gerrit Code Review
commit 94ec5eac0d
6 changed files with 170 additions and 0 deletions

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
tools/gate/lint-site.sh Executable file
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

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

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

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 }}"

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 }}"