diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..ff9e240a1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: node_js +sudo: false +dist: trusty +node_js: + - 10.9.0 +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 + chrome: stable +branches: + except: + - g3 +cache: + yarn: true + directories: + - "./node_modules" +before_install: + - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0 + - export PATH="$HOME/.yarn/bin:$PATH" +script: + - "./scripts/deploy/publish-docs-content.sh" + - "./scripts/deploy/deploy-cn.sh" diff --git a/package.json b/package.json index 3a0560798..8dc1aa431 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "gulp-cli": "^2.3.0", "gulp-sass": "^4.0.2", "highlight.js": "^10.4.0", - "husky": "5.0.1", + "husky": "5.0.6", "inquirer": "^7.1.0", "jasmine": "^3.5.0", "jasmine-core": "^3.5.0", diff --git a/scripts/deploy/deploy-cn.sh b/scripts/deploy/deploy-cn.sh new file mode 100755 index 000000000..01cbdaf05 --- /dev/null +++ b/scripts/deploy/deploy-cn.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -x +set -e + +git clone https://github.com/ng-docs/material.github.io.git + +cd ./material.github.io + +npm i + +./scripts/ci/deploy-cn.sh + +cd - + diff --git a/scripts/deploy/publish-docs-content.sh b/scripts/deploy/publish-docs-content.sh index 1a7de44bd..4c8e3a4b4 100755 --- a/scripts/deploy/publish-docs-content.sh +++ b/scripts/deploy/publish-docs-content.sh @@ -8,9 +8,9 @@ set -e cd "$(dirname $0)/../../" -if [ -z ${MATERIAL2_BUILDS_TOKEN} ]; then +if [ -z ${GITHUB_ACCESS_TOKEN} ]; then echo "Error: No access token for GitHub could be found." \ - "Please set the environment variable 'MATERIAL2_BUILDS_TOKEN'." + "Please set the environment variable 'GITHUB_ACCESS_TOKEN'." exit 1 fi @@ -28,13 +28,13 @@ docsContentPath="${projectPath}/tmp/material2-docs-content" examplesPackagePath="${projectPath}/dist/docs-content-pkg/" # Git clone URL for the material2-docs-content repository. -docsContentRepoUrl="https://github.com/angular/material2-docs-content" +docsContentRepoUrl="https://github.com/ng-docs/material2-docs-content" # Current version of Angular Material from the package.json file buildVersion=$(node -pe "require('./package.json').version") # Name of the branch that is currently being deployed. -branchName=${CIRCLE_BRANCH:-'master'} +branchName=${TRAVIS_BRANCH:-'master'} # Additional information about the last commit for docs-content commits. commitSha=$(git rev-parse --short HEAD) @@ -96,7 +96,7 @@ git config user.name "$commitAuthorName" git config user.email "$commitAuthorEmail" git config credential.helper "store --file=.git/credentials" -echo "https://${MATERIAL2_BUILDS_TOKEN}:@github.com" > .git/credentials +echo "https://${GITHUB_ACCESS_TOKEN}:@github.com" > .git/credentials echo "Credentials for docs-content repository are now set up. Publishing.." diff --git a/yarn.lock b/yarn.lock index 980512cad..14ae831db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6883,10 +6883,10 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -husky@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/husky/-/husky-5.0.1.tgz#c1b1f2b0da297399e295b6c204b680e45f26feda" - integrity sha512-ZNfMqtluHyMaW795l1jOLGOGSFAyZ6JC8jZj1QkagBmfuxrSFKX+Wrbb9gR+OD8iNJb8JNDpaMtCpE5XnLdHMw== +husky@5.0.6: + version "5.0.6" + resolved "https://registry.yarnpkg.com/husky/-/husky-5.0.6.tgz#27dbefe8603c6c0912fd89a3a67edfed9fac8bb9" + integrity sha512-SM+evfvcHT3rAYJKvPlatz3L5RqzgeM6xIvDjhs8VuhKj6iKqFDOt/Ov8sPjvWuE4FDB385gJBwWXRj7G3c1hg== iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.11: version "0.4.24"