diff options
author | Daniel Freedman <dfreedm2@gmail.com> | 2012-05-17 23:42:44 -0700 |
---|---|---|
committer | Daniel Freedman <dfreedm2@gmail.com> | 2012-05-17 23:42:44 -0700 |
commit | e105de46924064cf18fd51aab86b90c0e15ff055 (patch) | |
tree | ef54816d4b0a5c4891caf9159052a49062a45767 /deploy.sh | |
parent | 75ce58517b9eeb7a4b41e65c8a214cd1c0fabeee (diff) | |
download | biblez-ng-e105de46924064cf18fd51aab86b90c0e15ff055.tar.gz |
sh version of deploy.bat
Diffstat (limited to 'deploy.sh')
-rwxr-xr-x | deploy.sh | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..46547fe --- /dev/null +++ b/deploy.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# The location of this script +SOURCE=$(cd `dirname $0`; pwd) + +# extract project folder name +NAME=${SOURCE##*/} + +# target names +DEPLOY="$NAME-deploy" +TARGET="$SOURCE/../$DEPLOY" + +echo "This script can create a deployment in $TARGET" + +if [ -d $TARGET ]; then + echo "$DEPLOY folder already exists, please rename or remove it and try again." + exit +fi + +cat <<EOF +========== +build step +========== +EOF + +# FIXME: we push/pop to satisfy minify.bat requirement that package.js be in CWD + +pushd "$SOURCE/minify" +./minify.sh +popd + +cat <<EOF +========= +copy step +========= +EOF + +# make deploy folder +mkdir $TARGET + +# copy root folder files +cp $SOURCE/index.html $SOURCE/icon.png $TARGET + +# copy assets and build +cp -r $SOURCE/assets $SOURCE/build $TARGET + +# copy library items +mkdir $TARGET/lib + +for i in $SOURCE/lib/*; do + o=${i##*/} + if [ -x $i/deploy.sh ]; then + echo "Deploying $o" + $i/deploy.sh $TARGET/lib/$o + else + echo "Copying $o" + cp -r $i $TARGET/lib + fi +done |