diff --git a/scripts/snapshot-docs-site.sh b/scripts/snapshot-docs-site.sh new file mode 100755 index 00000000000..52d6d331b27 --- /dev/null +++ b/scripts/snapshot-docs-site.sh @@ -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 diff --git a/scripts/travis-build-init.sh b/scripts/travis-build-init.sh index 6f4c97384ef..6bbcffb1954 100755 --- a/scripts/travis-build-init.sh +++ b/scripts/travis-build-init.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash ARG_DEFS=( "--sha=(.*)" @@ -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