Add explicit error handling in more places

This commit is contained in:
Tianon Gravi 2014-12-23 15:59:29 -07:00
parent 2d4e8fea07
commit 1a0f624c3e
1 changed files with 15 additions and 4 deletions

View File

@ -292,7 +292,7 @@ while [ "$#" -gt 0 ]; do
done
if [ "$doBuild" ]; then
(
if ! (
set -x
cd "$gitRepo"
git reset -q HEAD
@ -301,19 +301,30 @@ while [ "$#" -gt 0 ]; do
git checkout -q "$gitRef" --
cd "$gitRepo/$gitDir"
"$dir/git-set-mtimes"
) &>> "$thisLog"
) &>> "$thisLog"; then
echo "- failed 'git checkout'; see $thisLog"
didFail=1
continue
fi
if ! (
set -x
"$docker" build -t "$repoTag" "$gitRepo/$gitDir"
) &>> "$thisLog"; then
echo "- failed; see $thisLog"
echo "- failed 'docker build'; see $thisLog"
didFail=1
continue
fi
for namespace in $namespaces; do
( set -x; "$docker" tag "$repoTag" "$namespace/$repoTag" ) &>> "$thisLog"
if ! (
set -x
"$docker" tag "$repoTag" "$namespace/$repoTag"
) &>> "$thisLog"; then
echo "- failed 'docker tag'; see $thisLog"
didFail=1
continue
fi
done
fi
;;