-
Notifications
You must be signed in to change notification settings - Fork 40
52 lines (49 loc) · 1.64 KB
/
validate.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
name: Validation
on: [pull_request, push]
jobs:
validate:
name: Validate files
runs-on: ubuntu-latest
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v3
# Check yaml files comply to schema
- name: Check YAML schema
run: |
curl -L https://github.com/neilpa/yajsv/releases/download/v1.4.0/yajsv.linux.amd64 > yajsv
chmod +x yajsv
./yajsv -s schema.json sites/*.yaml
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install requirements
run: pip install -r requirements.txt
- name: Validate GOC and VOs
run: |
./validate.sh
- name: Check all configs can be generated
run: |
exit_value=0
for f in sites/*.yaml; do
for c in "caso" "keystone" "cloudkeeper-os"; do
echo "$c config for $f"
if ! ./generate-config.py --config-type "$c" "$f" > /dev/null ; then
echo "FAILED!"
exit_value=1
fi
done
done
exit $exit_value
- name: Check all VOs are in the deployment dir
run: |
for f in sites/*.yaml; do
for vo in $(yq -r ".vos[].name" < "$f"); do
# remove FQAN stuff
# shellcheck disable=SC2001
vo=$(echo "$vo" | sed 's#/\([^/]*\)/.*#\1#')
grep "$vo" deploy/vos.yaml > /dev/null || (echo "VO $vo not configured" ; exit 1)
done
done