Merge "Self serve release docs"
[releng/global-jjb.git] / shell / info-file-validate.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo '--> info-file-validate.sh'
12 set -e -o pipefail
13 set -x  # Enable trace
14
15 virtualenv --quiet "/tmp/v/info"
16 # shellcheck source=/tmp/v/info/bin/activate disable=SC1091
17 source "/tmp/v/info/bin/activate"
18 pip install PyYAML jsonschema rfc3987 yamllint
19
20 # Download info-schema.yaml and yaml-verfy-schema.py
21 wget -q https://raw.githubusercontent.com/lfit/releng-global-jjb/master/schema/info-schema.yaml \
22 https://raw.githubusercontent.com/lfit/releng-global-jjb/master/yaml-verify-schema.py
23
24 yamllint INFO.yaml
25
26 python yaml-verify-schema.py \
27     -s info-schema.yaml \
28     -y INFO.yaml