372ce72e371235b8b269fd86544b91e1957d91bb
[yaffs-website] / vendor / drush / drush / tests / testChildren.sh
1 # See https://github.com/drush-ops/drush/pull/1426 for background information.
2 #
3 # $AUTH_TOKEN is provided via a secure Travis environment variable.
4 # Secure environment variables are not set for pull requests that
5 # originated from another repository, so skip child tests if $AUTH_TOKEN
6 # is empty.
7 if [ -n "$AUTH_TOKEN" ]
8 then
9   # After a travis build succeeds, run tests from any child repository defined in $TEST_CHILDREN
10   for CHILD in $TEST_CHILDREN
11   do
12     BUILD_NUM=$(curl -s "https://api.travis-ci.org/repos/$CHILD/builds" | grep -o '^\[{"id":[0-9]*,' | grep -o '[0-9]' | tr -d '\n')
13     echo "Restarting build $BUILD_NUM for $CHILD"
14     curl -X POST https://api.travis-ci.org/builds/$BUILD_NUM/restart --header "Authorization: token "$AUTH_TOKEN
15   done
16 fi