Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit f12159b

Browse files
devversionjelbourn
authored andcommitted
build: ensure docs-content is up-to-date before deploy (#505)
* Currently the `fetch-assets` script always fetches the data from the `master` branch. This is problematic because if we release a new patch release, we will incorrectly have the docs content for the upcoming major version. * Adds a small note that makes the publisher aware of the docs-content that should be kept updated.
1 parent b34e239 commit f12159b

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

tools/deploy.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eu -o pipefail
44

55
declare -A PROJECT_ID
66

7-
#Firebase project Ids
7+
# Firebase project ids
88
PROJECT_ID["stable", "dev"]="material2-docs-dev"
99
PROJECT_ID["stable", "prod"]="material-angular-io"
1010
PROJECT_ID["v5", "dev"]="material2-docs-5"
@@ -14,7 +14,17 @@ version=${1:-stable}
1414
mode=${2:-dev}
1515
projectId=${PROJECT_ID[$version, $mode]}
1616

17+
echo ""
18+
echo "NOTE: Make sure to refresh the docs-content to match the new version of docs."
19+
echo " You can pull the docs-content for the new version by using the fetch-assets script."
20+
echo ""
21+
echo " e.g. ./tools/fetch-assets.sh 6.4.x"
22+
echo ""
23+
24+
read -p "Press <ENTER> to continue.."
25+
1726
npm run build-themes
27+
1828
$(npm bin)/ng build --aot --prod --build-optimizer=false
1929
$(npm bin)/firebase use $projectId
2030
$(npm bin)/firebase deploy

tools/fetch-assets.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
cd $(dirname ${0})/../
88

9+
# Branch on the docs-content repository that includes the docs assets. The branch can
10+
# be specified because in some situations we do not always want the docs-content of the
11+
# master branch (e.g. if `master` reflects the next major version).
12+
docsContentBranch=${1:-'master'}
13+
914
# Directory where documentation assets should be copied to (overviews, api docs)
1015
documentsDestination=./src/assets/documents/
1116

@@ -33,8 +38,10 @@ mkdir -p ${materialExamplesDestination}
3338
# Remove previous repository if directory is present.
3439
rm -Rf ${docsContentPath}
3540

41+
echo "Pulling docs-content assets for the branch: ${docsContentBranch}."
42+
3643
# Clone the docs-content repository.
37-
git clone ${docsContentRepoUrl} ${docsContentPath} --depth 1
44+
git clone ${docsContentRepoUrl} ${docsContentPath} --depth 1 --branch ${docsContentBranch}
3845

3946
# Copy all document assets (API, overview and guides).
4047
cp -R ${docsContentPath}/api ${documentsDestination}

0 commit comments

Comments
 (0)