Extend release-job.sh to detect if distribution_type is missing
from the release yaml file and show a meaningful error. The
shell option pipefile causes the script to halt silently if
niet fails to find that key, which utterly baffles users.
Change-Id: I926097a1e9d94bd867879ce6fdc549415a911dbe
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
--- /dev/null
+---
+fixes:
+ - |
+ Extend release-job.sh to detect if distribution_type is missing
+ from the release yaml file and show a meaningful error. The
+ shell option pipefile causes the script to halt silently if
+ niet fails to find that key, which utterly baffles users.
pipup="python -m pip install -q --upgrade pip lftools jsonschema niet twine yq"
echo "INFO: $pipup"
$pipup
+# show installed versions
+python -m pip --version
+python -m pip freeze
#Functions.
fi
# Jenkins parameter drop-down defaults DISTRIBUTION_TYPE to None
+ # in the contain/maven release job; get value from release yaml.
+ # Packagecloud and PyPI jobs set the appropriate value.
DISTRIBUTION_TYPE="${DISTRIBUTION_TYPE:-None}"
if [[ $DISTRIBUTION_TYPE == "None" ]]; then
- DISTRIBUTION_TYPE=$(niet ".distribution_type" "$release_file")
+ if ! DISTRIBUTION_TYPE=$(niet ".distribution_type" "$release_file"); then
+ echo "ERROR: Failed to get distribution_type from $release_file"
+ exit 1
+ fi
fi
PATCH_DIR=$(mktemp -d)