From 3170475e85d7409d36889b59998152f9f754451e Mon Sep 17 00:00:00 2001 From: dsc Date: Tue, 7 Dec 2010 14:19:32 -0800 Subject: [PATCH] Adds deploy versioning. --- bin/deploy.sh | 14 +++++- www/deps.html | 130 +++++++++++++++++++++++++++--------------------------- www/uv-deps.html | 65 +++++++++++++++++++++++++++ 3 files changed, 142 insertions(+), 67 deletions(-) create mode 100644 www/uv-deps.html diff --git a/bin/deploy.sh b/bin/deploy.sh index f5c5f0c..92e73fb 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -23,6 +23,7 @@ Options: -v Verbose logging -n Dry-run -C Clean before rebuilding + -G Only emit the deploy version (Git commit abbreviation) HALP } @@ -34,18 +35,24 @@ 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 "nvC" opt; do +while getopts "nvCG" opt; do case $opt in n ) DRY_RUN="--dry-run"; incshift ;; v ) VERBOSE="-v"; incshift ;; C ) CLEAN="--clean"; incshift ;; + G ) GIT_VERSION_ONLY=1; incshift ;; esac done shift $SHIFT SRC="src/Y src/ezl src/tanks" EXCLUDE="--exclude=$(join ' --exclude=' 'tmp' 'src' 'bin' $*)" +GIT_VERSION=$(git show --oneline . | head -n1 | cut -d ' ' -f 1) +if test "$GIT_VERSION_ONLY"; then + echo "$GIT_VERSION" + exit +fi cat <<-SWEET_ART .__ __, @@ -54,6 +61,8 @@ cat <<-SWEET_ART SWEET_ART +echo "Deploy Version: $GIT_VERSION" + printf "Building documentation...\t\t" for md in doc/*.md; do markdown $md -f $md.html || fail "Error building markdown docs!" @@ -67,7 +76,8 @@ if test "$CLEAN"; then fi printf "Building and generating dep-graph...\t" -commonjs $SRC --script-tags > www/deps.html || fail "Error building modules!" +commonjs $SRC --script-tags > www/uv-deps.html || fail "Error building modules!" +sed -E 's|src="build/([^"]+)"|src="build/'$GIT_VERSION'/\1"|' www/uv-deps.html > www/deps.html echo "hokay" printf "Uploading files...\t\t\t" diff --git a/www/deps.html b/www/deps.html index 6a71653..6017a92 100644 --- a/www/deps.html +++ b/www/deps.html @@ -1,65 +1,65 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/www/uv-deps.html b/www/uv-deps.html new file mode 100644 index 0000000..6a71653 --- /dev/null +++ b/www/uv-deps.html @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.7.0.4