build: separate deploy jobs in deploy build stage (#5621)

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.
This commit is contained in:
Paul Gschwendtner
2017-07-10 20:38:09 +02:00
committed by Jeremy Elbourn
parent 145ca8e818
commit dabcd53bc9
6 changed files with 67 additions and 39 deletions
+5 -4
View File
@@ -28,9 +28,10 @@ jobs:
- env: "MODE=browserstack_required"
- env: "MODE=travis_required"
- stage: Deploy
script: ./scripts/ci/publish-artifacts.sh
env: "MODE=release"
env: "DEPLOY_MODE=build-artifacts"
- env: "DEPLOY_MODE=docs-content"
- env: "DEPLOY_MODE=screenshot-tool"
- env: "DEPLOY_MODE=dashboard"
env:
global:
- LOGS_DIR=/tmp/angular-material2-build/logs
@@ -51,7 +52,7 @@ before_script:
- mkdir -p $LOGS_DIR
script:
- ./scripts/ci/build-and-test.sh
- ./scripts/ci/travis-script.sh
cache:
directories:
Regular → Executable
View File
-35
View File
@@ -1,35 +0,0 @@
#!/bin/bash
# Script that runs after the testing stage of Travis passed.
# Build artifacts and docs content will be published to different repositories.
# The script should immediately exit if any command in the script fails.
set -e
# 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 cdk:build-release:clean
$(npm bin)/gulp material:build-release
$(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/deploy/publish-build-artifacts.sh --no-build &
./scripts/deploy/publish-docs-content.sh --no-build &
# Deploy the screenshot and dashboard functions for each push build.
./scripts/deploy/deploy-screenshot-functions.sh &
./scripts/deploy/deploy-dashboard.sh &
wait
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
# Script that runs in the deploy stage after the testing stage of Travis passed.
# Build artifacts and docs content will be published to different repositories.
# The script should immediately exit if any command in the script fails.
set -e
# Go to the project root directory
cd $(dirname $0)/../..
# If the current Travis job is triggered by a pull request skip the deployment.
# This check is necessary because Travis still tries to run the deploy build-stage for
# pull requests.
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
echo "Build artifacts and docs content will only be deployed in Travis push builds."
exit 0;
fi
echo ""
echo "Starting the deployment script. Running mode: ${DEPLOY_MODE}"
echo ""
if [[ "${DEPLOY_MODE}" == "build-artifacts" ]]; then
./scripts/deploy/publish-build-artifacts.sh
fi
if [[ "${DEPLOY_MODE}" == "docs-content" ]]; then
./scripts/deploy/publish-docs-content.sh
fi
if [[ "${DEPLOY_MODE}" == "screenshot-tool" ]]; then
./scripts/deploy/deploy-screenshot-functions.sh
fi
if [[ "${DEPLOY_MODE}" == "dashboard" ]]; then
./scripts/deploy/deploy-dashboard.sh
fi
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
# Script that runs in every Travis CI container. The script is responsible for delegating
# to the different scripts that should run for specific Travis jobs in a build stage.
# The script should immediately exit if any command in the script fails.
set -e
# Go to project directory
cd $(dirname $0)/../..
if [[ -z "$TRAVIS" ]]; then
echo "This script can only run inside of Travis build jobs."
exit 1
fi
if [[ "${MODE}" ]]; then
./scripts/ci/travis-testing.sh
elif [[ "${DEPLOY_MODE}" ]]; then
./scripts/ci/travis-deploy.sh
fi
@@ -1,5 +1,8 @@
#!/bin/bash
# Script that runs in the testing build stage of Travis and is responsible for testing
# the project in different Travis jobs of the current build stage.
# The script should immediately exit if any command in the script fails.
set -e