Skip to content

Commit 1993ac8

Browse files
author
Zhicheng WANG
committed
feat: 添加构建脚本
1 parent 48f0c84 commit 1993ac8

File tree

3 files changed

+44
-6
lines changed

3 files changed

+44
-6
lines changed

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
language: node_js
2+
sudo: false
3+
dist: trusty
4+
node_js:
5+
- 12.14.1
6+
addons:
7+
apt:
8+
sources:
9+
- ubuntu-toolchain-r-test
10+
packages:
11+
- g++-4.8
12+
chrome: stable
13+
branches:
14+
only:
15+
master
16+
cache:
17+
yarn: true
18+
directories:
19+
- "./node_modules"
20+
script:
21+
- "yarn build-docs-content"
22+
- "./scripts/deploy/publish-docs-content.sh"
23+
- "./scripts/deploy/deploy-cn.sh"

scripts/deploy/deploy-cn.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
set -e
5+
6+
git clone https://github.com/ng-docs/material.github.io.git
7+
8+
cd ./material.github.io
9+
10+
yarn
11+
12+
cp -r ../dist/docs-content-pkg/docs-content node_modules/@angular/components-examples/
13+
./scripts/ci/deploy-cn.sh
14+
15+
cd -

scripts/deploy/publish-docs-content.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ set -e
88

99
cd "$(dirname $0)/../../"
1010

11-
if [ -z ${MATERIAL2_BUILDS_TOKEN} ]; then
11+
if [ -z ${GITHUB_ACCESS_TOKEN} ]; then
1212
echo "Error: No access token for GitHub could be found." \
13-
"Please set the environment variable 'MATERIAL2_BUILDS_TOKEN'."
13+
"Please set the environment variable 'GITHUB_ACCESS_TOKEN'."
1414
exit 1
1515
fi
1616

@@ -25,16 +25,16 @@ docsContentPath="${projectPath}/tmp/material2-docs-content"
2525

2626
# Path to the build output of the Bazel "@angular/components-examples" NPM package.
2727
# Note: When changing this, also change the path in `scripts/build-docs-content.js`.
28-
examplesPackagePath="${projectPath}/dist/docs-content-pkg/"
28+
examplesPackagePath="${projectPath}/dist/docs-content-pkg"
2929

3030
# Git clone URL for the material2-docs-content repository.
31-
docsContentRepoUrl="https://github.com/angular/material2-docs-content"
31+
docsContentRepoUrl="https://github.com/ng-docs/material2-docs-content"
3232

3333
# Current version of Angular Material from the package.json file
3434
buildVersion=$(node -pe "require('./package.json').version")
3535

3636
# Name of the branch that is currently being deployed.
37-
branchName=${CIRCLE_BRANCH:-'master'}
37+
branchName=${TRAVIS_BRANCH:-'master'}
3838

3939
# Additional information about the last commit for docs-content commits.
4040
commitSha=$(git rev-parse --short HEAD)
@@ -96,7 +96,7 @@ git config user.name "$commitAuthorName"
9696
git config user.email "$commitAuthorEmail"
9797
git config credential.helper "store --file=.git/credentials"
9898

99-
echo "https://${MATERIAL2_BUILDS_TOKEN}:@github.com" > .git/credentials
99+
echo "https://asnowwolf:${GITHUB_ACCESS_TOKEN}@github.com" > .git/credentials
100100

101101
echo "Credentials for docs-content repository are now set up. Publishing.."
102102

0 commit comments

Comments
 (0)