Move code processing depends-on patches ahead

Logically the repos should be prepared firstly. So let's move
the code processing depends-on patches ahead.

Change-Id: Id27825970e77281c6f8879214c875c8d0af3526d
This commit is contained in:
Jianghua Wang 2016-11-16 10:37:11 +08:00
parent b637b4c286
commit c65aa9d1c1

View File

@ -175,6 +175,33 @@ sudo chown root:root $TEMPFILE
sudo mv $TEMPFILE /etc/sudoers.d/40_stack_sh
function pre_test_hook() {
(
# fetch depends-on patches.
if [ "${ZUUL_URL}" = "https://review.openstack.org/p" -a -n "$ZUUL_CHANGES" ]; then
# Neutron test nodes still depend on review.openstack.org to fetch changes.
# Need fetch depends-on patches specially.
changes=$(echo $ZUUL_CHANGES | tr '^' ' ')
echo "Processing depends-on changes: $changes"
for change in $changes; do
project=$(echo $change | cut -d: -f1);
# skip the changes belong to $ZUUL_PROJECT which
# has been done already the primary routine.
if [ "$project" = "$ZUUL_PROJECT" ]; then
echo -e "\tSkip the change: $change"
else
echo -e "\tFetching change: $change."
ref=$(echo $change | cut -d: -f3);
pushd $BASE/new/$(basename $project)
if git fetch $ZUUL_URL/$project $ref; then
git merge FETCH_HEAD
fi
popd
fi
done
fi
)
# Plugins
tar -czf - -C /opt/stack/new/nova/plugins/xenserver/xenapi/etc/xapi.d/plugins/ ./ |
run_in_domzero \
@ -278,32 +305,6 @@ EOF
fi
)
(
# fetch depends-on patches.
if [ "${ZUUL_URL}" = "https://review.openstack.org/p" -a -n "$ZUUL_CHANGES" ]; then
# Neutron test nodes still depend on review.openstack.org to fetch changes.
# Need fetch depends-on patches specially.
changes=$(echo $ZUUL_CHANGES | tr '^' ' ')
echo "Processing depends-on changes: $changes"
for change in $changes; do
project=$(echo $change | cut -d: -f1);
# skip the changes belong to $ZUUL_PROJECT which
# has been done already the primary routine.
if [ "$project" = "$ZUUL_PROJECT" ]; then
echo -e "\tSkip the change: $change"
else
echo -e "\tFetching change: $change."
ref=$(echo $change | cut -d: -f3);
pushd $BASE/new/$(basename $project)
if git fetch $ZUUL_URL/$project $ref; then
git merge FETCH_HEAD
fi
popd
fi
done
fi
)
# delete folders to save disk space
sudo rm -rf /opt/git
}