Zuul: Add basic validation script
See: https://pagure.io/fedora-comps/issue/785
This commit is contained in:
parent
852152c526
commit
f3d5b63793
9
.zuul.yaml
Normal file
9
.zuul.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
- project:
|
||||
check:
|
||||
jobs:
|
||||
- validate
|
||||
|
||||
- job:
|
||||
name: validate
|
||||
description: Validate comps files
|
||||
run: ci/validate.yaml
|
21
ci/validate
Executable file
21
ci/validate
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
main() {
|
||||
failure="false"
|
||||
|
||||
make sort || failure="true"
|
||||
make validate || failure="true"
|
||||
|
||||
# Fail if any changes were made to the repo
|
||||
if [[ -n "(git status --short)" ]]; then
|
||||
failure="true"
|
||||
fi
|
||||
if [[ "${failure}" == "true" ]]; then
|
||||
echo "At least one check failed!"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
main "${@}"
|
6
ci/validate.yaml
Normal file
6
ci/validate.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Validate comps files
|
||||
ansible.builtin.command:
|
||||
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
|
||||
cmd: ci/validate
|
Loading…
x
Reference in New Issue
Block a user