Update verify scripts to clean up even on failures

This commit is contained in:
Jeff Grafton
2016-06-15 18:42:31 -07:00
committed by Mike Danese
parent 3ba5816e46
commit e880dbfd25
4 changed files with 10 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ TMP_SPECROOT="${KUBE_ROOT}/_tmp/swagger-spec"
_tmp="${KUBE_ROOT}/_tmp"
mkdir -p "${_tmp}"
trap "rm -rf ${_tmp}" EXIT SIGINT
cp -a "${SPECROOT}" "${TMP_SPECROOT}"
"${KUBE_ROOT}/hack/update-swagger-spec.sh"
@@ -39,7 +40,6 @@ echo "diffing ${SPECROOT} against freshly generated swagger spec"
ret=0
diff -Naupr -I 'Auto generated by' "${SPECROOT}" "${TMP_SPECROOT}" || ret=$?
cp -a ${TMP_SPECROOT} "${KUBE_ROOT}/api"
rm -rf "${_tmp}"
if [[ $ret -eq 0 ]]
then
echo "${SPECROOT} up to date."