From dd0685930988a1bf03af588a5e203f6f55251199 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 3 Mar 2016 20:07:23 -0800 Subject: [PATCH 01/15] ci(analytics): fix TRAVIS_PULL_REQUEST reporting process.env.TRAVIS_PULL_REQUEST contains a string and not a boolean value, so we need to compare it to a string literal rather than do boolean arithmetics. --- tools/analytics/analytics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/analytics/analytics.js b/tools/analytics/analytics.js index b596b1a332e4..b36568401475 100644 --- a/tools/analytics/analytics.js +++ b/tools/analytics/analytics.js @@ -55,7 +55,7 @@ let customParams = { // Dev Environment cd4: process.env.TRAVIS ? 'Travis CI' : 'Local Dev', // Travis - Pull Request? - cd5: process.env.TRAVIS && process.env.TRAVIS_PULL_REQUEST ? 'true' : 'false', + cd5: (process.env.TRAVIS_PULL_REQUEST == 'true') ? 'true' : 'false', // Travis - Branch Name (master) cd6: process.env.TRAVIS_BRANCH, // Travis - Repo Slug (angular/angular) From 41ae9ebe34c661541c6d2bcfd4539ef8b208d409 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 3 Mar 2016 20:58:07 -0800 Subject: [PATCH 02/15] ci(analytics): report Travis ID without the build number prefix We need to track latency of individual jobs over time, but don't care to know what's the build ID that these jobs are associted with. --- tools/analytics/analytics.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/analytics/analytics.js b/tools/analytics/analytics.js index b36568401475..34b0e12d5aeb 100644 --- a/tools/analytics/analytics.js +++ b/tools/analytics/analytics.js @@ -60,8 +60,8 @@ let customParams = { cd6: process.env.TRAVIS_BRANCH, // Travis - Repo Slug (angular/angular) cd7: process.env.TRAVIS_REPO_SLUG, - // Travis - Job ID (4.1) - cd12: process.env.TRAVIS_JOB_NUMBER, + // Travis - Job ID (1, 2, 3, 4, ...) + cd12: process.env.TRAVIS_JOB_NUMBER ? process.env.TRAVIS_JOB_NUMBER.split('.')[1] : undefined, // HW - CPU Info cd8: `${os.cpus().length} x ${os.cpus()[0].model}`, // HW - Memory Info From f614824ecfad28c06530de3aed80094c53cadea1 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 3 Mar 2016 21:51:07 -0800 Subject: [PATCH 03/15] ci(analytics): correctly report CI job errors as errors --- tools/analytics/analytics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/analytics/analytics.js b/tools/analytics/analytics.js index 34b0e12d5aeb..836271001ed0 100644 --- a/tools/analytics/analytics.js +++ b/tools/analytics/analytics.js @@ -167,7 +167,7 @@ module.exports = { }, ciError: (actionName, duration) => { - recordEvent('success', 'ci', actionName, duration); + recordEvent('error', 'ci', actionName, duration); }, bundleSize: (filePath, sizeInBytes, compressionLevel) => { From a1ff16035c37ab643317fe82ccb8a1525f1c6e3c Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 3 Mar 2016 21:56:39 -0800 Subject: [PATCH 04/15] build(analytics): allow build analytics to take previous exit code as the first argument --- tools/analytics/build-analytics | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/analytics/build-analytics b/tools/analytics/build-analytics index 65f755cedec2..4271c8af292d 100755 --- a/tools/analytics/build-analytics +++ b/tools/analytics/build-analytics @@ -1,5 +1,10 @@ #!/usr/bin/env node +// Usage: +// +// build analytics start|success|error| + + 'use strict'; @@ -16,6 +21,11 @@ if (!analytics[actionCategory + 'Start']) { throw new Error('Unknown build-analytics actionCategory "' + actionCategory + '"'); } +var exitCode = Number.parseInt(eventType, 10); +if (!Number.isNaN(exitCode)) { + eventType = (exitCode === 0) ? 'success' : 'error'; +} + if (eventType != 'start' && eventType != 'success' && eventType != 'error') { throw new Error('Unknown build-analytics eventType "' + eventType + '"'); } From 373c71c99122afd0282e68918cf01437895a473e Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 09:30:45 -0800 Subject: [PATCH 05/15] ci(travis): use gcc v4.8 to compile npm native modules on Node v4 and v5 --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index ee3b92a980b8..9fc40a6834c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,9 @@ before_cache: env: global: + # Use newer verison of GCC to that is required to compile native npm modules for Node v4+ on Ubuntu Precise + # more info: https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements + - CXX=g++-4.8 - KARMA_DART_BROWSERS=DartiumWithWebPlatform # No sandbox mode is needed for Chromium in Travis, it crashes otherwise: https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start - KARMA_JS_BROWSERS=ChromeNoSandbox @@ -64,6 +67,11 @@ matrix: addons: firefox: "38.0" + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 before_install: - npm install -g npm@3.5.3 From 4795ddea158132709b762cc441c7bf3649a6bbc2 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 10:22:07 -0800 Subject: [PATCH 06/15] ci(travis): better document before_cache script --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9fc40a6834c4..61194f29bc10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,8 @@ cache: - $HOME/.chrome/chromium before_cache: - # Undo the pollution of the typescript_next build - - npm install typescript + # Undo the pollution of the typescript_next build before the cache is primed for future use + - if [[ "$MODE" == "typescript_next" ]]; then npm install typescript; fi env: global: From 84c25355d2cbe4307dc149de367c9bb1473aead8 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 11:16:32 -0800 Subject: [PATCH 07/15] ci(travis): remove bogus environmental variable --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 61194f29bc10..37728e78bb09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,7 +85,6 @@ before_install: - ./scripts/ci/init_android.sh - ./scripts/ci/install_dart.sh ${DART_CHANNEL} ${DART_VERSION} ${ARCH} - sh -e /etc/init.d/xvfb start -- if [[ -e SKIP_TRAVIS_TESTS ]]; then { cat SKIP_TRAVIS_TESTS ; exit 0; } fi - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && SAUCE_USERNAME="angular2-ci" && SAUCE_ACCESS_KEY="693ebc16208a-0b5b-1614-8d66-a2662f4e" || true' - node tools/analytics/build-analytics success ci before_install From 535aabe98656fbf54090ab6f4eb8814df51aef15 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 11:26:21 -0800 Subject: [PATCH 08/15] ci(travis): clean up, reorganize and document before_install and install scripts Functionally this should be a noop change. --- .travis.yml | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 37728e78bb09..5640e8a65b63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,23 +74,27 @@ addons: - g++-4.8 before_install: -- npm install -g npm@3.5.3 -- node tools/analytics/build-analytics start ci job -- node tools/analytics/build-analytics start ci before_install -- echo ${TSDRC} > .tsdrc -- ./scripts/ci/install_chromium.sh -- export CHROME_BIN=$HOME/.chrome/chromium/chrome-linux/chrome -- export DISPLAY=:99.0 -- export GIT_SHA=$(git rev-parse HEAD) -- ./scripts/ci/init_android.sh -- ./scripts/ci/install_dart.sh ${DART_CHANNEL} ${DART_VERSION} ${ARCH} -- sh -e /etc/init.d/xvfb start -- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && SAUCE_USERNAME="angular2-ci" && SAUCE_ACCESS_KEY="693ebc16208a-0b5b-1614-8d66-a2662f4e" || true' -- node tools/analytics/build-analytics success ci before_install + - node tools/analytics/build-analytics start ci job + - node tools/analytics/build-analytics start ci before_install + - echo ${TSDRC} > .tsdrc + - export CHROME_BIN=$HOME/.chrome/chromium/chrome-linux/chrome + - export DISPLAY=:99.0 + - export GIT_SHA=$(git rev-parse HEAD) + - ./scripts/ci/init_android.sh + - sh -e /etc/init.d/xvfb start + # Use a separate SauseLabs account for upstream/master builds in order for Sauce to create a badge representing the status of just upstream/master + - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && SAUCE_USERNAME="angular2-ci" && SAUCE_ACCESS_KEY="693ebc16208a-0b5b-1614-8d66-a2662f4e" || true' + - node tools/analytics/build-analytics success ci before_install install: - node tools/analytics/build-analytics start ci install - # Check the size of caches + # Install version of npm that we are locked against + - npm install -g npm@3.5.3 + # Install version of Chromium that we are locked against + - ./scripts/ci/install_chromium.sh + # Install version of Dart based on the matrix build variables + - ./scripts/ci/install_dart.sh ${DART_CHANNEL} ${DART_VERSION} ${ARCH} + # Print the size of caches to ease debugging - du -sh ./node_modules || true # Install npm dependecies # check-node-modules will exit(1) if we don't need to install From 2f27c41e65df580349108f4380ca76ab9ce563f3 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 14:57:36 -0800 Subject: [PATCH 09/15] ci(travis): clean up matrix environmental variables remove all unnecessary ones. --- .travis.yml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5640e8a65b63..50a37d08a476 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,8 @@ env: - ARCH=linux-x64 - DART_DEV_VERSION=latest - DART_STABLE_VERSION=latest + - DART_CHANNEL=stable + - DART_VERSION=$DART_STABLE_VERSION # Token for tsd to increase github rate limit # See https://github.com/DefinitelyTyped/tsd#tsdrc # This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables @@ -44,26 +46,26 @@ env: - secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo=" matrix: # Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete. - - MODE=dart DART_CHANNEL=stable DART_VERSION=$DART_STABLE_VERSION - - MODE=dart DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=saucelabs_required DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=browserstack_required DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=saucelabs_optional DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=browserstack_optional DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=dart_ddc DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=js DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=router DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=build_only DART_CHANNEL=stable DART_VERSION=$DART_STABLE_VERSION - - MODE=typescript_next DART_CHANNEL=stable DART_VERSION=$DART_STABLE_VERSION - - MODE=lint DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=payload DART_CHANNEL=stable DART_VERSION=$DART_STABLE_VERSION + - MODE=dart + - MODE=dart DART_CHANNEL=dev + - MODE=saucelabs_required + - MODE=browserstack_required + - MODE=saucelabs_optional + - MODE=browserstack_optional + - MODE=dart_ddc + - MODE=js + - MODE=router + - MODE=build_only + - MODE=typescript_next + - MODE=lint + - MODE=payload matrix: allow_failures: - - env: "MODE=saucelabs_optional DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION" - - env: "MODE=browserstack_optional DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION" + - env: "MODE=saucelabs_optional" + - env: "MODE=browserstack_optional" # Tracked in https://github.com/angular/angular/issues/7050 - - env: "MODE=typescript_next DART_CHANNEL=stable DART_VERSION=$DART_STABLE_VERSION" + - env: "MODE=typescript_next" addons: firefox: "38.0" From ce1b5a7c7081fe94fce36a921a6dffb44f9db760 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 16:05:34 -0800 Subject: [PATCH 10/15] ci(travis): fix indentation in of the .travis.yaml --- .travis.yml | 97 ++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/.travis.yml b/.travis.yml index 50a37d08a476..2bb09fee8bec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js sudo: false node_js: -- '5.4.1' + - '5.4.1' branches: except: @@ -18,32 +18,32 @@ before_cache: env: global: - # Use newer verison of GCC to that is required to compile native npm modules for Node v4+ on Ubuntu Precise - # more info: https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements - - CXX=g++-4.8 - - KARMA_DART_BROWSERS=DartiumWithWebPlatform - # No sandbox mode is needed for Chromium in Travis, it crashes otherwise: https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start - - KARMA_JS_BROWSERS=ChromeNoSandbox - - E2E_BROWSERS=ChromeOnTravis - - LOGS_DIR=/tmp/angular-build/logs - - SAUCE_USERNAME=angular-ci - - SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987 - - BROWSER_STACK_USERNAME=angularteam1 - - BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB - - ARCH=linux-x64 - - DART_DEV_VERSION=latest - - DART_STABLE_VERSION=latest - - DART_CHANNEL=stable - - DART_VERSION=$DART_STABLE_VERSION - # Token for tsd to increase github rate limit - # See https://github.com/DefinitelyTyped/tsd#tsdrc - # This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables - # because those are not visible for pull requests, and those should also be reliable. - # This SSO token belongs to github account angular-github-ratelimit-token which has no access - # (password is in Valentine) - - TSDRC='{"token":"ef474500309daea53d5991b3079159a29520a40b"}' - # GITHUB_TOKEN_ANGULAR - - secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo=" + # Use newer verison of GCC to that is required to compile native npm modules for Node v4+ on Ubuntu Precise + # more info: https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements + - CXX=g++-4.8 + - KARMA_DART_BROWSERS=DartiumWithWebPlatform + # No sandbox mode is needed for Chromium in Travis, it crashes otherwise: https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start + - KARMA_JS_BROWSERS=ChromeNoSandbox + - E2E_BROWSERS=ChromeOnTravis + - LOGS_DIR=/tmp/angular-build/logs + - SAUCE_USERNAME=angular-ci + - SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987 + - BROWSER_STACK_USERNAME=angularteam1 + - BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB + - ARCH=linux-x64 + - DART_DEV_VERSION=latest + - DART_STABLE_VERSION=latest + - DART_CHANNEL=stable + - DART_VERSION=$DART_STABLE_VERSION + # Token for tsd to increase github rate limit + # See https://github.com/DefinitelyTyped/tsd#tsdrc + # This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables + # because those are not visible for pull requests, and those should also be reliable. + # This SSO token belongs to github account angular-github-ratelimit-token which has no access + # (password is in Valentine) + - TSDRC='{"token":"ef474500309daea53d5991b3079159a29520a40b"}' + # GITHUB_TOKEN_ANGULAR + - secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo=" matrix: # Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete. - MODE=dart @@ -62,10 +62,10 @@ env: matrix: allow_failures: - - env: "MODE=saucelabs_optional" - - env: "MODE=browserstack_optional" - # Tracked in https://github.com/angular/angular/issues/7050 - - env: "MODE=typescript_next" + - env: "MODE=saucelabs_optional" + - env: "MODE=browserstack_optional" + # Tracked in https://github.com/angular/angular/issues/7050 + - env: "MODE=typescript_next" addons: firefox: "38.0" @@ -105,34 +105,33 @@ install: - node tools/analytics/build-analytics success ci install before_script: -- node tools/analytics/build-analytics start ci before_script -- mkdir -p $LOGS_DIR -- ./scripts/ci/presubmit-queue-setup.sh -- node tools/analytics/build-analytics success ci before_script + - node tools/analytics/build-analytics start ci before_script + - mkdir -p $LOGS_DIR + - ./scripts/ci/presubmit-queue-setup.sh + - node tools/analytics/build-analytics success ci before_script script: -- node tools/analytics/build-analytics start ci script -- ./scripts/ci/build_and_test.sh ${MODE} -- node tools/analytics/build-analytics success ci script + - node tools/analytics/build-analytics start ci script + - ./scripts/ci/build_and_test.sh ${MODE} + - node tools/analytics/build-analytics success ci script after_script: -- node tools/analytics/build-analytics start ci after_script -- ./scripts/ci/print-logs.sh -- ./scripts/ci/after-script.sh -- ./scripts/publish/publish-build-artifacts.sh -- node tools/analytics/build-analytics success ci after_script -- if [[ $TRAVIS_TEST_RESULT -eq 0 ]]; then node tools/analytics/build-analytics success ci job; else node tools/analytics/build-analytics error ci job; fi + - node tools/analytics/build-analytics start ci after_script + - ./scripts/ci/print-logs.sh + - ./scripts/ci/after-script.sh + - ./scripts/publish/publish-build-artifacts.sh + - node tools/analytics/build-analytics success ci after_script + - if [[ $TRAVIS_TEST_RESULT -eq 0 ]]; then node tools/analytics/build-analytics success ci job; else node tools/analytics/build-analytics error ci job; fi notifications: webhooks: urls: - - https://webhooks.gitter.im/e/1ef62e23078036f9cee4 - # trigger Buildtime Trend Service to parse Travis CI log - - https://buildtimetrend.herokuapp.com/travis - - http://104.197.9.155:8484/hubot/travis/activity + - https://webhooks.gitter.im/e/1ef62e23078036f9cee4 + # trigger Buildtime Trend Service to parse Travis CI log + - https://buildtimetrend.herokuapp.com/travis + - http://104.197.9.155:8484/hubot/travis/activity on_success: always # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always on_start: false # default: false slack: secure: EP4MzZ8JMyNQJ4S3cd5LEPWSMjC7ZRdzt3veelDiOeorJ6GwZfCDHncR+4BahDzQAuqyE/yNpZqaLbwRWloDi15qIUsm09vgl/1IyNky1Sqc6lEknhzIXpWSalo4/T9ZP8w870EoDvM/UO+LCV99R3wS8Nm9o99eLoWVb2HIUu0= - From aaf18100d4c54814b04b011669ab2408bfaf361e Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 16:30:58 -0800 Subject: [PATCH 11/15] ci(travis): fix typo in webhooks config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2bb09fee8bec..9bc2997d0df8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -132,6 +132,6 @@ notifications: - http://104.197.9.155:8484/hubot/travis/activity on_success: always # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always - on_start: false # default: false + on_start: never # default: never slack: secure: EP4MzZ8JMyNQJ4S3cd5LEPWSMjC7ZRdzt3veelDiOeorJ6GwZfCDHncR+4BahDzQAuqyE/yNpZqaLbwRWloDi15qIUsm09vgl/1IyNky1Sqc6lEknhzIXpWSalo4/T9ZP8w870EoDvM/UO+LCV99R3wS8Nm9o99eLoWVb2HIUu0= From 2d1fd9491e77abbfbe107a0861868f2ac83ee856 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 16:54:15 -0800 Subject: [PATCH 12/15] docs(CONTRIBUTING.md): clarify the difference between build and ci commit message scopes --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8be16545a03b..e65331a62708 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -180,8 +180,8 @@ Must be one of the following: * **refactor**: A code change that neither fixes a bug nor adds a feature * **perf**: A code change that improves performance * **test**: Adding missing tests or correcting existing tests -* **build**: Changes that affect the build system, CI configuration or external dependencies (example scopes: gulp, broccoli, npm) -* **ci**: Any changes to our CI configuration files and scripts (Travis, Circle CI, BrowserStack, SauceLabs) +* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) +* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) * **chore**: Other changes that don't modify `src` or `test` files ### Scope From 3d185bb5f689ed30066418a71257eac9542498ea Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 17:33:53 -0800 Subject: [PATCH 13/15] ci(travis): simplify job status reporting --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9bc2997d0df8..f31ef0d7d699 100644 --- a/.travis.yml +++ b/.travis.yml @@ -121,7 +121,7 @@ after_script: - ./scripts/ci/after-script.sh - ./scripts/publish/publish-build-artifacts.sh - node tools/analytics/build-analytics success ci after_script - - if [[ $TRAVIS_TEST_RESULT -eq 0 ]]; then node tools/analytics/build-analytics success ci job; else node tools/analytics/build-analytics error ci job; fi + - tools/analytics/build-analytics $TRAVIS_TEST_RESULT ci job notifications: webhooks: From 2d4e6b8cd10f1ef668e80a217899511d5a3357ec Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 18:00:16 -0800 Subject: [PATCH 14/15] ci(travis): publish artifacts only from the upstream/master jobs --- scripts/publish/publish-build-artifacts.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/publish/publish-build-artifacts.sh b/scripts/publish/publish-build-artifacts.sh index e1b782c6b004..0fb66b7d218c 100755 --- a/scripts/publish/publish-build-artifacts.sh +++ b/scripts/publish/publish-build-artifacts.sh @@ -59,7 +59,9 @@ function publishRepo { ) } -if [[ "$TRAVIS_REPO_SLUG" = "angular/angular" && "$MODE" == "build_only" ]]; then +if [[ "$TRAVIS_REPO_SLUG" == "angular/angular" && \ + "$TRAVIS_PULL_REQUEST" == "false" && \ + "$MODE" == "build_only" ]]; then scripts/publish/npm_prepare.sh angular2 publishRepo "js" "${JS_BUILD_ARTIFACTS_DIR}" From f2d96ac48963f66d6cd703f0f2d0775c471c3675 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 4 Mar 2016 19:16:12 -0800 Subject: [PATCH 15/15] ci(publish-build-artifacts.sh): skip all the work for builds other than upstream/master --- scripts/publish/publish-build-artifacts.sh | 36 +++++++++++++--------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/scripts/publish/publish-build-artifacts.sh b/scripts/publish/publish-build-artifacts.sh index 0fb66b7d218c..ef39d224c49c 100755 --- a/scripts/publish/publish-build-artifacts.sh +++ b/scripts/publish/publish-build-artifacts.sh @@ -1,21 +1,6 @@ #!/bin/bash set -e -x -DART_BUILD_ARTIFACTS_DIR="dist/pub/angular2" -JS_BUILD_ARTIFACTS_DIR="dist/npm/angular2" - -DART_BUILD_BRANCH="builds-dart" -JS_BUILD_BRANCH="builds-js" - -REPO_URL="https://github.com/angular/angular.git" -# Use the below URL for testing when using SSH authentication -# REPO_URL="git@github.com:angular/angular.git" - -SHA=`git rev-parse HEAD` -SHORT_SHA=`git rev-parse --short HEAD` -COMMIT_MSG=`git log --oneline | head -n1` -COMMITTER_USER_NAME=`git --no-pager show -s --format='%cN' HEAD` -COMMITTER_USER_EMAIL=`git --no-pager show -s --format='%cE' HEAD` function publishRepo { LANG=$1 @@ -59,13 +44,34 @@ function publishRepo { ) } + if [[ "$TRAVIS_REPO_SLUG" == "angular/angular" && \ "$TRAVIS_PULL_REQUEST" == "false" && \ "$MODE" == "build_only" ]]; then + + DART_BUILD_ARTIFACTS_DIR="dist/pub/angular2" + JS_BUILD_ARTIFACTS_DIR="dist/npm/angular2" + + DART_BUILD_BRANCH="builds-dart" + JS_BUILD_BRANCH="builds-js" + + REPO_URL="https://github.com/angular/angular.git" + # Use the below URL for testing when using SSH authentication + # REPO_URL="git@github.com:angular/angular.git" + + SHA=`git rev-parse HEAD` + SHORT_SHA=`git rev-parse --short HEAD` + COMMIT_MSG=`git log --oneline | head -n1` + COMMITTER_USER_NAME=`git --no-pager show -s --format='%cN' HEAD` + COMMITTER_USER_EMAIL=`git --no-pager show -s --format='%cE' HEAD` + scripts/publish/npm_prepare.sh angular2 publishRepo "js" "${JS_BUILD_ARTIFACTS_DIR}" scripts/publish/pub_prepare.sh angular2 publishRepo "dart" "${DART_BUILD_ARTIFACTS_DIR}" echo "Finished publishing build artifacts" + +else + echo "Not building the upstream/master branch, build artifacts won't be published." fi