Merge "Make requirement update proposals more robust."

This commit is contained in:
Jenkins 2014-02-06 22:15:36 +00:00 committed by Gerrit Code Review
commit 6a94aa26c2

View File

@ -16,6 +16,7 @@ INITIAL_COMMIT_MSG="Updated from global requirements"
TOPIC="openstack/requirements"
USERNAME=${USERNAME:-$USER}
BRANCH=$ZUUL_REF
ALL_SUCCESS=0
if [ -z "$BRANCH" ] ; then
echo "No branch set, exiting."
@ -60,11 +61,8 @@ EOF
# make sure the project even has this branch
if git branch -a | grep -q "^ remotes/origin/$BRANCH$" ; then
git checkout $BRANCH
git checkout origin/${BRANCH}
git review -s
if [ -n "$change_id" ] ; then
git review -d $change_id
fi
popd
python update.py $PROJECT_DIR
@ -73,15 +71,22 @@ EOF
if ! git diff --exit-code HEAD ; then
# Commit and review
git_args="-a -F-"
if [ -n "$change_id" ] ; then
git_args="--amend $git_args"
fi
git commit $git_args <<EOF
$COMMIT_MSG
EOF
git review -t $TOPIC $BRANCH
# Do error checking manually to ignore one class of failure.
set +e
OUTPUT=$(git review -t $TOPIC $BRANCH)
RET=$?
[[ "$RET" -eq "0" || "$OUTPUT" =~ "no new changes" ]]
SUCCESS=$?
[[ "$SUCCESS" -eq "0" && "$ALL_SUCCESS" -eq "0" ]]
ALL_SUCCESS=$?
set -e
fi
fi
popd
done
exit $ALL_SUCCESS