Merge "Add check manifests zuul job"

This commit is contained in:
Zuul 2021-12-21 12:12:12 +00:00 committed by Gerrit Code Review
commit 7948a127d7
5 changed files with 67 additions and 0 deletions

View File

@ -310,6 +310,11 @@ docker-image-golint: docker-image_MAKETGT = golint
docker-image-golint: docker-image_DOCKERTGT = builder
docker-image-golint: docker-image
.PHONY: docker-image-check-manifests
docker-image-check-manifests: docker-image_MAKETGT = "generate manifests check-git-diff"
docker-image-check-manifests: docker-image_DOCKERTGT = builder
docker-image-check-manifests: docker-image
.PHONY: clean
clean:
@rm -fr $(BIN_DIR)

View File

@ -0,0 +1,20 @@
# 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: Run manifests check
block:
- name: "make docker-image-check-manifests"
make:
chdir: "{{ zuul.project.src_dir }}"
target: docker-image-check-manifests

View File

@ -30,6 +30,20 @@ then
exit 1
fi
git diff-files --quiet --ignore-submodules **/zz_generated.deepcopy.go
if [ $? -ne 0 ]
then
echo "git diff found modified zz_generated.deepcopy.go file, please run make generate"
exit 1
fi
git diff-files --quiet --ignore-submodules manifests/function/airshipctl-schemas/airshipit.org_*.yaml
if [ $? -ne 0 ]
then
echo "git diff found modified CRD files, please run make manifests"
exit 1
fi
# Evaluate git index for differences, if found print message and fail.
git diff-index --cached --quiet --ignore-submodules HEAD -- **/*.golden
if [ $? -ne 0 ]
@ -45,4 +59,18 @@ then
exit 1
fi
git diff-index --cached --quiet --ignore-submodules HEAD **/zz_generated.deepcopy.go
if [ $? -ne 0 ]
then
echo "git diff found modified zz_generated.deepcopy.go file, please run make generate"
exit 1
fi
git diff-index --cached --quiet --ignore-submodules HEAD manifests/function/airshipctl-schemas/airshipit.org_*.yaml
if [ $? -ne 0 ]
then
echo "git diff found modified CRD files, please run make manifests"
exit 1
fi
echo "no git diff detected, make target completed successfully"

View File

@ -42,6 +42,12 @@
nodeset: airship-airshipctl-single-node
files: *gofiles
- job:
name: airship-airshipctl-check-manifests
pre-run: playbooks/airship-airshipctl-deploy-docker.yaml
run: playbooks/airship-airshipctl-check-manifests.yaml
nodeset: airship-airshipctl-single-node
- job:
name: airship-airshipctl-check-github-issues
description: Checks if a Github issue is referenced in the commit message
@ -125,6 +131,8 @@
soft: true
- name: airship-airshipctl-unit
soft: true
- name: airship-airshipctl-check-manifests
soft: true
- name: airship-airshipctl-build-image
soft: true
vars:
@ -164,6 +172,8 @@
soft: true
- name: airship-airshipctl-golint
soft: true
- name: airship-airshipctl-check-manifests
soft: true
- name: airship-airshipctl-unit
soft: true
- name: airship-airshipctl-build-image
@ -206,6 +216,8 @@
soft: true
- name: airship-airshipctl-golint
soft: true
- name: airship-airshipctl-check-manifests
soft: true
- name: airship-airshipctl-build-image
soft: true
- name: airship-airshipctl-validate-site-docs

View File

@ -34,6 +34,7 @@
- airship-airshipctl-golint
- airship-airshipctl-lint
- airship-airshipctl-unit
- airship-airshipctl-check-manifests
- airship-airshipctl-roles-test
- airship-airshipctl-check-github-issues
- airship-airshipctl-build-image
@ -53,6 +54,7 @@
- openstack-tox-docs: *docs
- airship-airshipctl-lint
- airship-airshipctl-unit
- airship-airshipctl-check-manifests
- airship-airshipctl-build-image
- airship-airshipctl-validate-site-docs
- airship-airshipctl-gate-script-runner