diff options
| author | Tobias Bosch | 2013-12-13 12:49:42 -0800 | 
|---|---|---|
| committer | Tobias Bosch | 2013-12-13 12:51:13 -0800 | 
| commit | 8c10db384727643265b1550543011d3193dfe557 (patch) | |
| tree | 836f583f1618e6dc1814afc6ee9265957402b74a /scripts/code.angularjs.org | |
| parent | 03088d60109582fa5e966ad8425b3de9d9152b6a (diff) | |
| download | angular.js-8c10db384727643265b1550543011d3193dfe557.tar.bz2 | |
chore(build): automate cutting a release, publishing to bower and to code.angular.js
Diffstat (limited to 'scripts/code.angularjs.org')
| -rw-r--r-- | scripts/code.angularjs.org/README.md | 19 | ||||
| -rwxr-xr-x | scripts/code.angularjs.org/publish.sh | 57 | 
2 files changed, 76 insertions, 0 deletions
| diff --git a/scripts/code.angularjs.org/README.md b/scripts/code.angularjs.org/README.md new file mode 100644 index 00000000..fd034102 --- /dev/null +++ b/scripts/code.angularjs.org/README.md @@ -0,0 +1,19 @@ +# code.angular.js.org Script + +Script for updating code.angularjs.org repo from current local build. + +Requires `node` (for parsing `bower.json`) + +Note: This should only be run for a release build, not a snapshot build! + +## Instructions + +`grunt package`: Build angular locally + +```shell +./publish.sh +``` + +## License +MIT + diff --git a/scripts/code.angularjs.org/publish.sh b/scripts/code.angularjs.org/publish.sh new file mode 100755 index 00000000..9eab269a --- /dev/null +++ b/scripts/code.angularjs.org/publish.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# +# update all the things +# + +set -e # fail if any command fails + +cd `dirname $0` +SCRIPT_DIR=`pwd` + +export TMP_DIR=../../tmp +export REPO_DIR=$TMP_DIR/code.angularjs.org + +export BUILD_DIR=../../build + +NEW_VERSION=$(node -e "console.log(require(process.env.BUILD_DIR+'/version.json').full)" | sed -e 's/\r//g') + +# +# Don't publish snapshot builds! +# +if [[ "$NEW_VERSION" =~ sha ]] ;then +  echo "publish to code.angularjs.org is not allowed for snapshot builds" +  exit 1; +fi + +exit 2 + +# +# clone +# + +git clone git@github.com:angular/code.angularjs.org.git $REPO_DIR + +# +# copy the files from the build +# + +mkdir $REPO_DIR/$NEW_VERSION + +cd $REPO_DIR +git reset --hard HEAD +git checkout master +git fetch --all +git reset --hard origin/master +cd $SCRIPT_DIR +cp -r $BUILD_DIR/* $REPO_DIR/$NEW_VERSION/ + +# +# commit and push +# + +cd $REPO_DIR +git add -A +git commit -m "v$NEW_VERSION" +# TODO git push origin master +cd $SCRIPT_DIR | 
