Skip to content

Commit 58c8404

Browse files
devversiontinayuangao
authored andcommitted
build: use travis build stages (#4766)
1 parent 1789f40 commit 58c8404

File tree

4 files changed

+45
-46
lines changed

4 files changed

+45
-46
lines changed

.travis.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ branches:
1414
only:
1515
- master
1616

17+
jobs:
18+
include:
19+
# Lint runs as a main job. Workaround for https://github.com/travis-ci/travis-ci/issues/7777
20+
- env: "MODE=e2e"
21+
- env: "MODE=aot"
22+
- env: "MODE=payload"
23+
- env: "MODE=closure-compiler"
24+
- env: "MODE=saucelabs_required"
25+
- env: "MODE=browserstack_required"
26+
- stage: Deploy
27+
script: ./scripts/ci/publish-artifacts.sh
28+
env: "MODE=release"
29+
1730
env:
1831
global:
1932
- LOGS_DIR=/tmp/angular-material2-build/logs
@@ -22,22 +35,9 @@ env:
2235
- BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB
2336
- BROWSER_PROVIDER_READY_FILE=/tmp/angular-material2-build/readyfile
2437
- BROWSER_PROVIDER_ERROR_FILE=/tmp/angular-material2-build/errorfile
25-
2638
matrix:
27-
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
28-
- MODE=lint
29-
- MODE=aot
30-
- MODE=closure-compiler
31-
- MODE=payload
32-
- MODE=e2e
33-
- MODE=saucelabs_required
34-
- MODE=browserstack_required
35-
36-
matrix:
37-
fast_finish: true
38-
allow_failures:
39-
- env: "MODE=saucelabs_optional"
40-
- env: "MODE=browserstack_optional"
39+
# Workaround for https://github.com/travis-ci/travis-ci/issues/7777. Running lint as main job.
40+
- MODE=lint
4141

4242
before_install:
4343
- source ./scripts/ci/env.sh
@@ -51,9 +51,6 @@ before_script:
5151
script:
5252
- ./scripts/ci/build-and-test.sh
5353

54-
after_success:
55-
- ./scripts/ci/after-success.sh
56-
5754
cache:
5855
directories:
5956
- node_modules

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
"selenium-webdriver": "^3.4.0",
112112
"sorcery": "^0.10.0",
113113
"stylelint": "^7.10.1",
114-
"travis-after-modes": "^0.0.7",
115114
"ts-node": "^3.0.4",
116115
"tslint": "^5.2.0",
117116
"typescript": "~2.2.1",

scripts/ci/after-success.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

scripts/ci/publish-artifacts.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Script that runs after the testing stage of Travis passed.
4+
# Build artifacts and docs content will be published to different repositories.
5+
6+
# Go to the project root directory
7+
cd $(dirname $0)/../..
8+
9+
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
10+
echo "Build artifacts and docs content will only be deployed in Travis push builds."
11+
exit 0;
12+
fi
13+
14+
echo "Starting to publish the build artifacts and docs content..."
15+
echo ""
16+
17+
# Build Material, CDK and the docs before publishing artifacts
18+
$(npm bin)/gulp material:build-release:clean
19+
$(npm bin)/gulp material-examples:build-release
20+
$(npm bin)/gulp docs
21+
22+
# Run publishing of artifacts in parallel.
23+
# This is possible because the output has been built before.
24+
./scripts/release/publish-build-artifacts.sh --no-build &
25+
./scripts/release/publish-docs-content.sh --no-build &
26+
27+
# Deploy the screenshot functions for each push build.
28+
./scripts/release/deploy-screenshot-functions.sh &
29+
30+
wait

0 commit comments

Comments
 (0)