diff --git a/.travis.yml b/.travis.yml index 59d3b3b48494..d60fd6f8b00b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,19 @@ branches: only: - master +jobs: + include: + # Lint runs as a main job. Workaround for https://github.com/travis-ci/travis-ci/issues/7777 + - env: "MODE=e2e" + - env: "MODE=aot" + - env: "MODE=payload" + - env: "MODE=closure-compiler" + - env: "MODE=saucelabs_required" + - env: "MODE=browserstack_required" + - stage: Deploy + script: ./scripts/ci/publish-artifacts.sh + env: "MODE=release" + env: global: - LOGS_DIR=/tmp/angular-material2-build/logs @@ -22,22 +35,9 @@ env: - BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB - BROWSER_PROVIDER_READY_FILE=/tmp/angular-material2-build/readyfile - BROWSER_PROVIDER_ERROR_FILE=/tmp/angular-material2-build/errorfile - matrix: - # Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete. - - MODE=lint - - MODE=aot - - MODE=closure-compiler - - MODE=payload - - MODE=e2e - - MODE=saucelabs_required - - MODE=browserstack_required - -matrix: - fast_finish: true - allow_failures: - - env: "MODE=saucelabs_optional" - - env: "MODE=browserstack_optional" + # Workaround for https://github.com/travis-ci/travis-ci/issues/7777. Running lint as main job. + - MODE=lint before_install: - source ./scripts/ci/env.sh @@ -51,9 +51,6 @@ before_script: script: - ./scripts/ci/build-and-test.sh -after_success: - - ./scripts/ci/after-success.sh - cache: directories: - node_modules diff --git a/package.json b/package.json index 1c84538eb975..cd0be4ca61f3 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,6 @@ "selenium-webdriver": "^3.4.0", "sorcery": "^0.10.0", "stylelint": "^7.10.1", - "travis-after-modes": "^0.0.7", "ts-node": "^3.0.4", "tslint": "^5.2.0", "typescript": "~2.2.1", diff --git a/scripts/ci/after-success.sh b/scripts/ci/after-success.sh deleted file mode 100755 index d16f853087e6..000000000000 --- a/scripts/ci/after-success.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# Script which always runs when the current Travis mode succeeds. -# Used to run the travis-after-modes script, which checks if all other modes finished. - -# Go to the project root directory -cd $(dirname $0)/../.. - -# If not running as a PR, wait for all other travis modes to finish. -if [ "$TRAVIS_PULL_REQUEST" = "false" ] && $(npm bin)/travis-after-modes; then - echo "All travis modes passed. Publishing the build artifacts..." - echo "" - - # Build Material, CDK and the docs before publishing artifacts - $(npm bin)/gulp material:build-release:clean - $(npm bin)/gulp material-examples:build-release - $(npm bin)/gulp docs - - # Run publishing of artifacts in parallel. This is possible because the output has been built before. - ./scripts/release/publish-build-artifacts.sh --no-build & - ./scripts/release/publish-docs-content.sh --no-build & - - # Deploy the screenshot functions for each push build. - ./scripts/release/deploy-screenshot-functions.sh & - - wait -#fi diff --git a/scripts/ci/publish-artifacts.sh b/scripts/ci/publish-artifacts.sh new file mode 100755 index 000000000000..455579e05488 --- /dev/null +++ b/scripts/ci/publish-artifacts.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Script that runs after the testing stage of Travis passed. +# Build artifacts and docs content will be published to different repositories. + +# Go to the project root directory +cd $(dirname $0)/../.. + +if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then + echo "Build artifacts and docs content will only be deployed in Travis push builds." + exit 0; +fi + +echo "Starting to publish the build artifacts and docs content..." +echo "" + +# Build Material, CDK and the docs before publishing artifacts +$(npm bin)/gulp material:build-release:clean +$(npm bin)/gulp material-examples:build-release +$(npm bin)/gulp docs + +# Run publishing of artifacts in parallel. +# This is possible because the output has been built before. +./scripts/release/publish-build-artifacts.sh --no-build & +./scripts/release/publish-docs-content.sh --no-build & + +# Deploy the screenshot functions for each push build. +./scripts/release/deploy-screenshot-functions.sh & + +wait