build: publish material-examples package to docs content (#4064)

This commit is contained in:
Paul Gschwendtner
2017-04-12 17:40:31 -07:00
committed by Jeremy Elbourn
parent 60ea218c67
commit 205690f359
2 changed files with 12 additions and 12 deletions
+10 -10
View File
@@ -6,14 +6,13 @@
cd "$(dirname $0)/../../"
docsPath="./dist/docs"
packagePath="./dist/releases/material-examples"
repoPath="/tmp/material2-docs-content"
repoUrl="https://github.com/angular/material2-docs-content"
examplesSource="./dist/docs/examples"
# If the docs directory is not present, generate docs
if [ ! -d $docsPath ]; then
$(npm bin)/gulp docs
fi
$(npm bin)/gulp examples:release
$(npm bin)/gulp docs
# Get git meta info for commit
commitSha="$(git rev-parse --short HEAD)"
@@ -28,15 +27,16 @@ git clone $repoUrl $repoPath
# Clean out repo directory and copy contents of dist/docs into it
rm -rf $repoPath/*
mkdir $repoPath/overview
mkdir $repoPath/guides
mkdir $repoPath/api
mkdir $repoPath/examples
mkdir $repoPath/plunker
# Create folders that will contain docs content files.
mkdir $repoPath/{overview,guides,api,examples,plunker,examples-package}
# Copy api files over to $repoPath/api
cp -r $docsPath/api/* $repoPath/api
# Copy the material-examples package to the docs content repository.
cp -r $packagePath/* $repoPath/examples-package
# Flatten the markdown docs structure and move it into $repoPath/overview
overviewFiles=$docsPath/markdown/
for filename in $overviewFiles*
@@ -65,7 +65,7 @@ done
cp -r $examplesSource/* $repoPath/examples
# Copy example plunker assets
rsync -a $docsPath/plunker $repoPath/plunker
cp -r $docsPath/plunker/* $repoPath/plunker
# Copies assets over to the docs-content repository.
cp LICENSE $repoPath/
+2 -2
View File
@@ -88,7 +88,7 @@ task('highlight-examples', () => {
path.basename = `${path.basename}-${extension}`;
};
return src('src/examples/**/*.+(html|css|ts)')
return src('src/material-examples/**/*.+(html|css|ts)')
.pipe(flatten())
.pipe(rename(renameFile))
.pipe(highlight())
@@ -111,7 +111,7 @@ task('minified-api-docs', ['api-docs'], () => {
/** Copies example sources to be used as plunker assets for the docs site. */
task('plunker-example-assets', () => {
src(path.join(SOURCE_ROOT, 'examples', '**/*'))
src(path.join(SOURCE_ROOT, 'material-examples', '**/*'))
.pipe(dest(path.join(DIST_DOCS, 'plunker', 'examples')));
});