diff --git a/.travis.yml b/.travis.yml index b2794c909..b46c50792 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,8 +33,8 @@ before_install: - export DISPLAY=:99.0 - ./scripts/travis/install.sh before_script: -- ./scripts/travis/setup.sh - ./scripts/travis/rebase.sh +- ./scripts/travis/setup.sh script: - ./scripts/travis/build.sh after_success: diff --git a/scripts/travis/presubmit.sh b/scripts/travis/presubmit.sh index 236ab354e..f9d84338a 100755 --- a/scripts/travis/presubmit.sh +++ b/scripts/travis/presubmit.sh @@ -1,9 +1,9 @@ #!/bin/bash set -e -# If we're on the branch which name is of the form branch1-q-branch2 -# and all the tests pass, push this branch as branch2. Note that -# branch1 would alreay have been rebased onto branch2 by this point. +# If we're on the branch which name is of the form branch1-q-* +# and all the tests have passed, push this branch as branch1. Note that +# branch1-q-* would alreay have been rebased onto branch1 by this point. echo '***************' echo '** PRESUBMIT **' @@ -18,11 +18,11 @@ echo Current branch is: $TRAVIS_BRANCH echo Test result is: $TRAVIS_TEST_RESULT if [ "$TRAVIS_REPO_SLUG" = "markovuksanovic/angular.dart" ]; then - if [ $TRAVIS_TEST_RESULT -eq 0 ] && [[ $TRAVIS_BRANCH =~ ^(.*)-q-(.*)$ ]]; then + if [ $TRAVIS_TEST_RESULT -eq 0 ] && [[ $TRAVIS_BRANCH =~ ^(.*)-q-.*$ ]]; then echo "Pushing HEAD to ${BASH_REMATCH[2]}..." - if git push upstream HEAD:${BASH_REMATCH[2]}; then - echo "${BASH_REMATCH[1]} has been merged into ${BASH_REMATCH[2]}, deleting..." - git push upstream :"${BASH_REMATCH[1]}" + if git push upstream HEAD:${BASH_REMATCH[1]}; then + echo "${BASH_REMATCH[0]} has been merged into ${BASH_REMATCH[1]}, deleting..." + git push upstream :"${BASH_REMATCH[0]}" fi fi fi diff --git a/scripts/travis/rebase.sh b/scripts/travis/rebase.sh index 25af3d45c..dee179ae7 100755 --- a/scripts/travis/rebase.sh +++ b/scripts/travis/rebase.sh @@ -2,9 +2,10 @@ set -e # If we're on the branch which has the name of the form -# branch1-q-branch2 we rebase branch1 onto branch2 -# If we're on the presubmit branch, the dev Dart release, and all unit -# tests pass, merge the presubmit branch into master and push it. +# branch1-q-* we rebase branch1-q-* onto branch1. +# This will leave system in detached head state. After this +# tests will be run. Pushing the code into appropriate +# branch is done during in "after_success" phase. echo '***************' echo '** REBASE **' @@ -18,9 +19,9 @@ echo Current channel is: $CHANNEL echo Current branch is: $TRAVIS_BRANCH if [ "$TRAVIS_REPO_SLUG" = "markovuksanovic/angular.dart" ]; then - if [[ $TRAVIS_BRANCH =~ ^(.*)-q-(.*)$ ]]; then + if [[ $TRAVIS_BRANCH =~ ^(.*)-q-.*$ ]]; then FROM=${BASH_REMATCH[0]} - ONTO=${BASH_REMATCH[2]} + ONTO=${BASH_REMATCH[1]} git config credential.helper "store --file=.git/credentials" # travis encrypt GITHUB_TOKEN_ANGULAR_ORG=??? --repo=angular/angular.dart echo "https://${GITHUB_TOKEN_ANGULAR_ORG}:@github.com" > .git/credentials