diff options
| author | Tobias Bosch | 2014-01-09 14:39:48 -0800 | 
|---|---|---|
| committer | Tobias Bosch | 2014-01-09 14:59:55 -0800 | 
| commit | 9ddef840b665bd94a49102a4e3dbc433f7b29b9a (patch) | |
| tree | 68baa133bd27fde473bd700c15532ca26347cf5f /scripts/angularjs.org | |
| parent | 28fc80bba0107075ab371fd0a7634a38891626b2 (diff) | |
| download | angular.js-9ddef840b665bd94a49102a4e3dbc433f7b29b9a.tar.bz2 | |
chore(build): add relase-after-cdn script
Diffstat (limited to 'scripts/angularjs.org')
| -rwxr-xr-x | scripts/angularjs.org/publish.sh | 47 | 
1 files changed, 47 insertions, 0 deletions
| diff --git a/scripts/angularjs.org/publish.sh b/scripts/angularjs.org/publish.sh new file mode 100755 index 00000000..1efb621b --- /dev/null +++ b/scripts/angularjs.org/publish.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# Script for updating angularjs.org repo + +echo "#################################" +echo "##### Update angularjs.org ######" +echo "#################################" + +ARG_DEFS=( +  "--action=(prepare|publish)" +  "--cdn-version=(.*)" +) + +function init { +  TMP_DIR=$(resolveDir ../../tmp) +  REPO_DIR=$TMP_DIR/angularjs.org +} + +function prepare { +  echo "-- Cloning angularjs.org" +  git clone git@github.com:angular/angularjs.org.git $REPO_DIR + +  # +  # update files +  # +  echo "-- Updating angularjs.org" +  cd $REPO_DIR +  VERSION_REGEX="[a-z0-9\-\.\+]+" + +  replaceInFile "index.html" "(ajax\/libs\/angularjs\/)$VERSION_REGEX" "\1$CDN_VERSION" +  replaceInFile "index.html" "(<span class=\"version\">[^<]*<span>)$VERSION_REGEX" "\1$CDN_VERSION" +  replaceInFile "index.html" "(code.angularjs.org\/)$VERSION_REGEX" "\1$CDN_VERSION" + +  replaceInFile "js/homepage.js" "($scope.CURRENT_STABLE_VERSION[ ]*=[ ]*')$VERSION_REGEX" "\1$CDN_VERSION" +  replaceInFile "js/homepage.js" "($scope.CURRENT_UNSTABLE_VERSION[ ]*=[ ]*')$VERSION_REGEX" "\1$CDN_VERSION" + +  git add index.html +  git add js/homepage.js +  git commit -m "update(version): update angular version to $CDN_VERSION" +} + +function publish { +  cd $REPO_DIR +  echo "-- Pushing angularjs.org" +  git push origin master +} + +source $(dirname $0)/../utils.inc | 
