Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
feat(build): add script to snapshot docs site
Browse files Browse the repository at this point in the history
run snapshot script on travis
enforce token for github access
snapshot only commits to master
rename snapshot to HEAD

Closes #2852.
  • Loading branch information
matthewrfindley authored and ThomasBurleson committed May 15, 2015
1 parent af9f896 commit 76e3672
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
41 changes: 41 additions & 0 deletions scripts/snapshot-docs-site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

ARG_DEFS=(
"--version=(.*)"
)

function run {
cd ../

echo "-- Building docs site release..."
rm -rf dist
gulp docs --release

echo "-- Cloning code.material.angularjs.org..."
rm -rf code.material.angularjs.org
git clone https://angular:$GH_TOKEN@github.com/angular/code.material.angularjs.org.git --depth=1

echo "-- Remove previous snapshot..."
rm -rf code.material.angularjs.org/HEAD

echo "-- Copying docs site to snapshot..."
cp -Rf dist/docs code.material.angularjs.org/HEAD

cd code.material.angularjs.org

echo "-- Commiting snapshot..."
git add -A
git commit -m "snapshot: $VERSION"

echo "-- Pushing snapshot..."
git push -q origin master

cd ../

echo "-- Cleanup..."
rm -rf code.material.angularjs.org

echo "-- Successfully pushed the snapshot to angular/code.material.angularjs.org!!"
}

source $(dirname $0)/utils.inc
3 changes: 2 additions & 1 deletion scripts/travis-build-init.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash

ARG_DEFS=(
"--sha=(.*)"
Expand All @@ -22,6 +22,7 @@ function run {
NEW_VERSION="$(readJsonProp "package.json" "version")-master-$(echo $SHA | head -c 7)"

./scripts/bower-material-release.sh --version=$NEW_VERSION
./scripts/snapshot-docs-site.sh --version=$NEW_VERSION
}

source $(dirname $0)/utils.inc

0 comments on commit 76e3672

Please sign in to comment.