Skip to content

Commit

Permalink
Merge branch 'master' into adam/fix-issue-373
Browse files Browse the repository at this point in the history
  • Loading branch information
CaerusKaru authored Feb 17, 2018
2 parents e9c77b0 + 04b9bfd commit 3263489
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 50 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ jobs:
- env: "MODE=aot"
- env: "MODE=prerender"
- env: "MODE=ssr"
# Closure Compiler CI check is temporarily disabled until a new version of
# the tool is released with https://github.com/google/closure-compiler/pull/2600
# - env: "MODE=closure-compiler"
- env: "MODE=saucelabs_required"
- env: "MODE=browserstack_required"
- env: "MODE=travis_required"
- stage: Deploy
env: "DEPLOY_MODE=build-artifacts"
if: type = push
# Closure Compiler CI check is temporarily disabled until a new version of
# the tool is released with https://github.com/google/closure-compiler/pull/2600
# - env: "MODE=closure-compiler"
env:
global:
- LOGS_DIR=/tmp/flex-layout-build/logs
Expand Down
36 changes: 8 additions & 28 deletions scripts/ci/travis-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ cd $(dirname $0)/../..
# Load the retry-call utility function.
source scripts/retry-call.sh

# 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

# Variable the specifies how often the deploy script should be invoked if it fails.
DEPLOY_RETRIES=1
Expand All @@ -27,25 +20,12 @@ echo ""
echo "Starting the deployment script. Running mode: ${DEPLOY_MODE}"
echo ""

# Deployment of the screenshot tool or dashboard should happen inside of a Cronjob.
# For example, always deploying the screenshot functions on a per-commit base might cause problems
# with the screenshot tests, because the functions can be non-responsive for a few seconds.
if [[ "${TRAVIS_EVENT_TYPE}" == "cron" ]]; then
if [[ "${DEPLOY_MODE}" == "screenshot-tool" ]]; then
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/deploy-screenshot-tool.sh
fi

if [[ "${DEPLOY_MODE}" == "dashboard" ]]; then
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/deploy-dashboard.sh
fi
# Deployment of the build artifacts and docs-content should only happen on a per-commit base.
# The target is to provide build artifacts in the GitHub repository for every commit.
else
if [[ "${DEPLOY_MODE}" == "build-artifacts" ]]; then
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/publish-build-artifacts.sh
fi

if [[ "${DEPLOY_MODE}" == "docs-content" ]]; then
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/publish-docs-content.sh
fi
if [[ "${DEPLOY_MODE}" == "screenshot-tool" ]]; then
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/deploy-screenshot-tool.sh
elif [[ "${DEPLOY_MODE}" == "dashboard" ]]; then
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/deploy-dashboard.sh
elif [[ "${DEPLOY_MODE}" == "build-artifacts" ]]; then
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/publish-build-artifacts.sh
elif [[ "${DEPLOY_MODE}" == "docs-content" ]]; then
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/publish-docs-content.sh
fi
6 changes: 4 additions & 2 deletions scripts/ci/travis-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ if [[ -z "${TRAVIS}" ]]; then
exit 0
fi

# If FIREBASE_ACCESS_TOKEN not set yet, export the FIREBASE_ACCESS_TOKEN using the JWT token that Travis generated and exported for SAUCE_ACCESS_KEY.
# If FIREBASE_ACCESS_TOKEN not set yet, export the FIREBASE_ACCESS_TOKEN using the JWT token that
# Travis generated and exported for SAUCE_ACCESS_KEY.
# This is a workaround for travis-ci/travis-ci#7223
# WARNING: FIREBASE_ACCESS_TOKEN should NOT be printed
export FIREBASE_ACCESS_TOKEN=${FIREBASE_ACCESS_TOKEN:-$SAUCE_ACCESS_KEY}

# - we overwrite the value set by Travis JWT addon here to work around travis-ci/travis-ci#7223 for FIREBASE_ACCESS_TOKEN
# - we overwrite the value set by Travis JWT addon here to work around travis-ci/travis-ci#7223
# for FIREBASE_ACCESS_TOKEN
export SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
5 changes: 0 additions & 5 deletions scripts/ci/travis-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ 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
Expand Down
25 changes: 13 additions & 12 deletions tools/tslint-rules/deletionTargetRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ export class Rule extends Lint.Rules.AbstractRule {
return this.applyWithFunction(sourceFile, (ctx: Lint.WalkContext<any>) => {
utils.forEachComment(ctx.sourceFile, (file, {pos, end}) => {
const commentText = file.substring(pos, end);

if (commentText.indexOf('@deletion-target') === -1) {
return;
}

const version = commentText.match(/\d+\.\d+\.\d+/);

if (!version) {
ctx.addFailure(pos, end, '@deletion-target must have a version.');
} else if (this._hasExpired(packageVersion, version[0])) {
ctx.addFailure(pos, end, `Deletion target at ${version[0]} is due to be deleted. ` +
`Current version is ${packageVersion}.`);
const hasDeletionTarget = commentText.indexOf('@deletion-target') > -1;

if (!hasDeletionTarget && commentText.indexOf('@deprecated') > -1) {
ctx.addFailure(pos, end, '@deprecated marker has to have a @deletion-target.');
} if (hasDeletionTarget) {
const version = commentText.match(/\d+\.\d+\.\d+/);

if (!version) {
ctx.addFailure(pos, end, '@deletion-target must have a version.');
} else if (this._hasExpired(packageVersion, version[0])) {
ctx.addFailure(pos, end, `Deletion target at ${version[0]} is due to be deleted. ` +
`Current version is ${packageVersion}.`);
}
}
});
});
Expand Down

0 comments on commit 3263489

Please sign in to comment.