Skip to content

Commit

Permalink
Some more refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mvuksano committed May 20, 2014
1 parent ce6d93c commit 5457fd0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 7 additions & 7 deletions scripts/travis/presubmit.sh
Original file line number Diff line number Diff line change
@@ -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 **'
Expand All @@ -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
11 changes: 6 additions & 5 deletions scripts/travis/rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 **'
Expand All @@ -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
Expand Down

0 comments on commit 5457fd0

Please sign in to comment.