Skip to content

Commit 40cf492

Browse files
committed
build: separate deploy jobs in deploy build stage
Currently every deployment runs in a single Travis job concurrently. This messes up the logs and it's also hard to see what actually runs at all. The different deployment jobs should run concurrently in the deploy build stage.
1 parent 077ebf6 commit 40cf492

File tree

6 files changed

+59
-39
lines changed

6 files changed

+59
-39
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ jobs:
2828
- env: "MODE=browserstack_required"
2929
- env: "MODE=travis_required"
3030
- stage: Deploy
31-
script: ./scripts/ci/publish-artifacts.sh
32-
env: "MODE=release"
33-
31+
env: "DEPLOY_MODE=build-artifacts"
32+
- env: "DEPLOY_MODE=docs-content"
33+
- env: "DEPLOY_MODE=screenshot-tool"
34+
- env: "DEPLOY_MODE=dashboard"
3435
env:
3536
global:
3637
- LOGS_DIR=/tmp/angular-material2-build/logs
@@ -51,7 +52,7 @@ before_script:
5152
- mkdir -p $LOGS_DIR
5253

5354
script:
54-
- ./scripts/ci/build-and-test.sh
55+
- ./scripts/ci/travis-script.sh
5556

5657
cache:
5758
directories:

scripts/ci/env.sh

100644100755
File mode changed.

scripts/ci/publish-artifacts.sh

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

scripts/ci/travis-deploy.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 in the deploy stage after the testing stage of Travis passed.
4+
# Build artifacts and docs content will be published to different repositories.
5+
6+
# The script should immediately exit if any command in the script fails.
7+
set -e
8+
9+
# Go to the project root directory
10+
cd $(dirname $0)/../..
11+
12+
echo ""
13+
echo "Starting the deployment script. Running mode: ${DEPLOY_MODE}"
14+
echo ""
15+
16+
if [[ "${DEPLOY_MODE}" == "build-artifacts" ]]; then
17+
./scripts/deploy/publish-build-artifacts.sh
18+
fi
19+
20+
if [[ "${DEPLOY_MODE}" == "docs-content" ]]; then
21+
./scripts/deploy/publish-docs-content.sh
22+
fi
23+
24+
if [[ "${DEPLOY_MODE}" == "screenshot-tool" ]]; then
25+
./scripts/deploy/deploy-screenshot-functions.sh
26+
fi
27+
28+
if [[ "${DEPLOY_MODE}" == "dashboard" ]]; then
29+
./scripts/deploy/deploy-dashboard.sh
30+
fi

scripts/ci/travis-script.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Script that runs in every Travis CI container. The script is responsible for delegating
4+
# to the different scripts that should run for specific Travis jobs in a build stage.
5+
6+
# The script should immediately exit if any command in the script fails.
7+
set -e
8+
9+
# Go to project directory
10+
cd $(dirname $0)/../..
11+
12+
if [[ -z "$TRAVIS" ]]; then
13+
echo "This script can only run inside of Travis build jobs."
14+
exit 1
15+
fi
16+
17+
if [[ "${MODE}" ]]; then
18+
./scripts/ci/travis-testing.sh
19+
elif [[ "${DEPLOY_MODE}" ]]; then
20+
./scripts/ci/travis-deploy.sh
21+
fi

scripts/ci/build-and-test.sh renamed to scripts/ci/travis-testing.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
# Script that runs in the testing build stage of Travis and is responsible for testing
4+
# the project in different Travis jobs of the current build stage.
5+
36
# The script should immediately exit if any command in the script fails.
47
set -e
58

0 commit comments

Comments
 (0)