Skip to content

Commit c5f8c95

Browse files
mheverytravis@travis-ci.org
authored andcommitted
chore: added presubmit-queue to travis
1 parent 4cfe92c commit c5f8c95

4 files changed

Lines changed: 101 additions & 3 deletions

File tree

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,18 @@ env:
2727
# This SSO token belongs to github account angular-github-ratelimit-token which has no access
2828
# (password is in Valentine)
2929
- TSDRC='{"token":"ef474500309daea53d5991b3079159a29520a40b"}'
30+
# GITHUB_TOKEN_ANGULAR
31+
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
3032
matrix:
31-
- MODE=js DART_CHANNEL=dev
33+
# Make slowest build on top, so that we don't hog VMs while waiting for others to complete.
3234
- MODE=dart DART_CHANNEL=stable
3335
- MODE=dart DART_CHANNEL=dev
3436
- MODE=dart_experimental DART_CHANNEL=dev
35-
- MODE=saucelabs DART_CHANNEL=dev
37+
- MODE=js DART_CHANNEL=dev
38+
# Dissabled until we can make it pass.
39+
# - MODE=saucelabs DART_CHANNEL=dev
3640

37-
matrix:
41+
matrix:
3842
allow_failures:
3943
- env: "MODE=saucelabs DART_CHANNEL=dev"
4044

@@ -61,12 +65,14 @@ install:
6165

6266
before_script:
6367
- mkdir -p $LOGS_DIR
68+
- ./scripts/ci/presubmit-queue-setup.sh
6469

6570
script:
6671
- ./scripts/ci/build_and_test.sh ${MODE}
6772

6873
after_script:
6974
- ./scripts/ci/print-logs.sh
75+
- ./scripts/ci/after-script.sh
7076

7177
notifications:
7278
webhooks:

scripts/ci/after-script.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
set -e -o pipefail
3+
4+
echo '*******************'
5+
echo '** AFTER_SUCCESS **'
6+
echo '*******************'
7+
8+
9+
echo '---------------------'
10+
echo '-- WAIT FOR OTHERS --'
11+
echo '---------------------'
12+
13+
curl -Lo travis_after_all.py https://raw.github.com/jbdeboer/travis_after_all/master/travis_after_all.py
14+
python travis_after_all.py
15+
. .to_export_back
16+
17+
echo BUILD_LEADER=$BUILD_LEADER
18+
echo BUILD_AGGREGATE_STATUS=$BUILD_AGGREGATE_STATUS
19+
20+
if [ "$BUILD_LEADER" = "YES" ]; then
21+
if [ "$BUILD_AGGREGATE_STATUS" = "others_succeeded" ]; then
22+
./scripts/ci/presubmit-queue-success.sh
23+
else
24+
echo "ERROR: Some Failed, not submitting"
25+
fi
26+
else
27+
echo "ERROR: Other builds have not finished, not submitting"
28+
fi
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
set -e -o pipefail
3+
4+
if [ "$TRAVIS_REPO_SLUG" = "angular/angular" ]; then
5+
if [[ $TRAVIS_BRANCH == "presubmit-"* ]]; then
6+
7+
echo '*********************'
8+
echo '** PRESUBMIT SETUP **'
9+
echo '*********************'
10+
11+
git config credential.helper "store --file=.git/credentials"
12+
# travis encrypt GITHUB_TOKEN_ANGULAR=??? --repo=angular/angular
13+
echo "https://${GITHUB_TOKEN_ANGULAR}:@github.com" > .git/credentials
14+
git config user.name "travis@travis-ci.org"
15+
16+
git remote add upstream https://github.com/angular/angular.git
17+
git fetch upstream master
18+
git rebase upstream/master
19+
fi
20+
fi
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
set -e -o pipefail
3+
4+
# If we're on the presubmit branch, the dev Dart release, and all unit
5+
# tests pass, merge the presubmit branch into master and push it.
6+
7+
8+
CHANNEL=`echo $JOB | cut -f 2 -d -`
9+
SHA=`git rev-parse HEAD`
10+
11+
echo Current channel is: $CHANNEL
12+
echo Current branch is: $TRAVIS_BRANCH
13+
echo Test result is: $TRAVIS_TEST_RESULT
14+
15+
if [ "$TRAVIS_REPO_SLUG" = "angular/angular" ]; then
16+
if [ $TRAVIS_TEST_RESULT -eq 0 ] && [[ $TRAVIS_BRANCH == "presubmit-"* ]]; then
17+
echo '***************'
18+
echo '** PRESUBMIT **'
19+
echo '***************'
20+
echo
21+
echo "Pushing HEAD to master..."
22+
git stash
23+
git fetch upstream master
24+
git rebase upstream/master
25+
if git push upstream HEAD:master; then
26+
echo "$TRAVIS_BRANCH has been merged into master, deleting..."
27+
git push upstream :"$TRAVIS_BRANCH"
28+
else
29+
COMITTER_EMAIL=`git --no-pager show -s --format='%cE' HEAD`
30+
echo Sending failure email to ${COMITTER_EMAIL}
31+
mail \
32+
-s "Failed to merge branch $TRAVIS_BRANCH to master" \
33+
${COMMITTER_EMAIL} \
34+
<< EOM
35+
Your travis branch ${TRAVIS_BRANCH} failed!
36+
37+
https://travis-ci.org/angular/angular/builds/${TRAVIS_JOB_ID}
38+
39+
Please take a look.
40+
EOM
41+
fi
42+
fi
43+
fi
44+
`

0 commit comments

Comments
 (0)