set -e
# the following two methods exist in scripts/build_utils.sh
-pkgs=( "ansible" "ansible-core" "git+https://opendev.org/jjb/jenkins-job-builder@60f0316389" "urllib3==1.26.1" "pyopenssl" "ndg-httpsclient" "pyasn1" )
+pkgs=( "ansible" "ansible-core" "git+https://opendev.org/jjb/jenkins-job-builder@60f0316389" "urllib3==1.26.1" "pyopenssl" "ndg-httpsclient" "pyasn1" "xmltodict" )
TEMPVENV=$(create_venv_dir)
VENV=${TEMPVENV}/bin
install_python_packages $TEMPVENV "pkgs[@]"
-
+rm -rf xml
# Test every definition if available in the current repository and update the jobs
# if they do define one (they should always define their definitions)
for dir in `find . -maxdepth 1 -path ./.git -prune -o -type d -print`; do
echo "found definitions directory: $definitions_dir"
# Test the definitions
- $VENV/jenkins-jobs test $definitions_dir --config-xml > /dev/null
+ $VENV/jenkins-jobs test $definitions_dir --config-xml -o ./xml > /dev/null
fi
done
+dpkg -l shellcheck >/dev/null 2>&1 || sudo apt install -y shellcheck
+PATH=$PATH:$VENV find ./xml -name '*.xml' -print0 | xargs -0 -L1 "$WORKSPACE/scripts/shellcheck_job.py"
+
# install ansible-galaxy roles for playbook syntax check
for reqs in $WORKSPACE/ansible/requirements/*; do
$VENV/ansible-galaxy install -r $reqs -p $WORKSPACE/ansible/roles --force