jobs:
- gerrit-jenkins-cfg-merge
+ - gerrit-jenkins-cfg-verify
- gerrit-jenkins-sandbox-cleanup
- gerrit-jjb-deploy-job
- gerrit-jjb-merge
jobs:
- github-jenkins-cfg-merge
+ - github-jenkins-cfg-verify
- github-jenkins-sandbox-cleanup
- github-jjb-deploy-job
- github-jjb-merge
url: '{git-clone-url}{github-org}/{project}'
refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
branch: '$sha1'
- submodule-recursive: '{submodule-recursive}'
+ submodule-recursive: true
submodule-timeout: '{submodule-timeout}'
choosing-strategy: default
jenkins-ssh-credential: '{jenkins-ssh-credential}'
# Verifies that openstack contains an image for each config file defined in the
# jenkins-config/clouds/openstack directory.
+set -eux -o pipefail
+
error=false
for file in jenkins-config/clouds/openstack/*/*; do
# Set the $IMAGE_NAME variable to the the file's IMAGE_NAME value
- export "$(grep IMAGE_NAME $file)"
+ export "$(grep ^IMAGE_NAME= $file)"
# The image should be listed as active
- openstack image list --property name="$IMAGE_NAME" | grep "active"
- if [ $? -ne 0 ]; then
+
+ if ! openstack image list --property name="$IMAGE_NAME" | grep "active"; then
echo "ERROR: No matching image found for $IMAGE_NAME"
error=true
fi
+ # Set the $HARDWARE_ID variable to the the file's HARDWARE_ID value
+ export "$(grep ^HARDWARE_ID= $file)"
+ # The flavor should be listed. Spaces in grep string ensure complete match.
+
+ if ! openstack flavor list | grep " $HARDWARE_ID "; then
+ echo "ERROR: No matching flavor found for $HARDWARE_ID"
+ error=true
+ fi
done
-if [ "$error" = true ]; then
+if $error; then
exit 1
fi