From 9a4c9e6487e0f51275a7820d0c162aceeadbf561 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Fri, 13 Dec 2013 20:02:15 -0800 Subject: chore(build): correct and refactor release script --- scripts/bower/publish.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'scripts/bower') diff --git a/scripts/bower/publish.sh b/scripts/bower/publish.sh index fec1927d..2549a139 100755 --- a/scripts/bower/publish.sh +++ b/scripts/bower/publish.sh @@ -1,19 +1,21 @@ #!/bin/bash -# -# update all the things -# - -set -e # fail if any command fails +echo "#################################" +echo "#### Update bower ###############" +echo "#################################" +# Enable tracing and exit on first failure +set -xe +# Normalize working dir to script dir cd `dirname $0` + SCRIPT_DIR=`pwd` +# export so that node.js can read those env settings export TMP_DIR=../../tmp - export BUILD_DIR=../../build -NEW_VERSION=$(node -e "console.log(require(process.env.BUILD_DIR+'/version.json').full)" | sed -e 's/\r//g') +NEW_VERSION=`cat $BUILD_DIR/version.txt` REPOS=( angular \ @@ -34,6 +36,7 @@ REPOS=( # for repo in "${REPOS[@]}" do + echo "-- Cloning bower-$repo" git clone git@github.com:angular/bower-$repo.git $TMP_DIR/bower-$repo done @@ -46,6 +49,7 @@ for repo in "${REPOS[@]}" do if [ -f $BUILD_DIR/$repo.js ] # ignore i18l then + echo "-- Updating files in bower-$repo" cd $TMP_DIR/bower-$repo git reset --hard HEAD git checkout master @@ -78,12 +82,15 @@ echo $NEW_VERSION for repo in "${REPOS[@]}" do + echo "-- Updating version in bower-$repo from $OLD_VERSION to $NEW_VERSION" cd $TMP_DIR/bower-$repo sed -i '' -e "s/$OLD_VERSION/$NEW_VERSION/g" bower.json git add -A + + echo "-- Committing, tagging and pushing bower-$repo" git commit -m "v$NEW_VERSION" git tag v$NEW_VERSION - # TODO git push origin master - # TODO git push origin v$NEW_VERSION + git push origin master + git push origin v$NEW_VERSION cd $SCRIPT_DIR done -- cgit v1.2.3