2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
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'
13 PROJECT="${PROJECT:-None}"
15 # shellcheck disable=SC1090
17 lf-activate-venv zipp==1.1.0 PyYAML jsonschema rfc3987 yamllint yq
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
26 python yaml-verify-schema.py \
31 # Verfiy that there is only one repository and that it matches $PROJECT
32 REPO_LIST="$(yq -r '.repositories[]' INFO.yaml)"
34 while IFS= read -r project; do
35 if [[ "$project" == "$PROJECT" ]]; then
36 echo "$project is valid"
38 echo "ERROR: $project is invalid"
39 echo "INFO.yaml file may only list one repository"
40 echo "Repository must match $PROJECT"