From 5a03ae9be611bfd9b2535262352fcead58fc43d1 Mon Sep 17 00:00:00 2001 From: dsc Date: Tue, 7 Dec 2010 05:48:29 -0800 Subject: [PATCH] Updates deploy dirs --- .gitignore | 3 +- bin/deploy.sh | 30 +++++++++++++++++-------- tags.html | 65 --------------------------------------------------------- 3 files changed, 22 insertions(+), 76 deletions(-) delete mode 100644 tags.html diff --git a/.gitignore b/.gitignore index 080d845..9108187 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -*.md.html tmp/ build/ .commonjs +*.md.html +*.pyc diff --git a/bin/deploy.sh b/bin/deploy.sh index 8e56ec1..f5c5f0c 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -19,9 +19,10 @@ them as arguments; {tmp,src,bin} are automatically excluded. TODO: Optionally minify using Google Closure Compiler. Options: - -h Displays this help. - -v Verbose logging. - -n Dry-run. + -h Displays this help + -v Verbose logging + -n Dry-run + -C Clean before rebuilding HALP } @@ -33,15 +34,19 @@ function join () { sep="$1"; out="$2"; shift 2; for a in $*; do out="${out}${sep for opt in $*; do echo $opt | egrep -xq -e '--?h(e(lp?)?)?' && { halp; exit 0; } done -while getopts "nv" opt; do +while getopts "nvC" opt; do case $opt in n ) DRY_RUN="--dry-run"; incshift ;; v ) VERBOSE="-v"; incshift ;; + C ) CLEAN="--clean"; incshift ;; esac done shift $SHIFT + +SRC="src/Y src/ezl src/tanks" EXCLUDE="--exclude=$(join ' --exclude=' 'tmp' 'src' 'bin' $*)" + cat <<-SWEET_ART .__ __, ,/__\=: The Littlest Deployer of Battletanks :=/__\. @@ -49,24 +54,29 @@ cat <<-SWEET_ART SWEET_ART -printf "Building documentation...\t" +printf "Building documentation...\t\t" for md in doc/*.md; do markdown $md -f $md.html || fail "Error building markdown docs!" done echo "hokay" -printf "Building project...\t\t" -commonjs src/{Y,ezl,tanks} --clean || fail "Error cleaning modules!" -commonjs src/{Y,ezl,tanks} --script-tags > tags.html || fail "Error building modules!" +if test "$CLEAN"; then + printf "Cleaning and rebuilding...\t\t" + commonjs $SRC $CLEAN || fail "Error cleaning project!" + echo "hokay" +fi + +printf "Building and generating dep-graph...\t" +commonjs $SRC --script-tags > www/deps.html || fail "Error building modules!" echo "hokay" -printf "Uploading files...\t\t" +printf "Uploading files...\t\t\t" test "$VERBOSE" && echo && echo "rsync -Caz $VERBOSE $DRY_RUN --delete $EXCLUDE ./* tanks@lttlst.com:www/" rsync -Caz $VERBOSE $DRY_RUN --delete $EXCLUDE ./* tanks@lttlst.com:www/ \ || fail "rsync failed!" echo "hokay" -printf "Updating permissions...\t\t" +printf "Updating permissions...\t\t\t" test "$VERBOSE" && echo && echo "ssh tanks@lttlst.com 'chown -R tanks:www /home/tanks/www && chmod -R 775 /home/tanks/www'" ssh tanks@lttlst.com 'chown -R tanks:www /home/tanks/www && chmod -R 775 /home/tanks/www' \ || fail "unable to update permissions on deployed files!" diff --git a/tags.html b/tags.html deleted file mode 100644 index 6a71653..0000000 --- a/tags.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- 1.7.0.4