From: dsc Date: Tue, 8 May 2012 19:43:00 +0000 (-0700) Subject: Documentation. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=d2f35878f129166cc046fe74b3354ea1e5197ffb;p=limn-bak.git Documentation. --- diff --git a/deploy.sh b/deploy.sh index f2bcf13..72276bc 100755 --- a/deploy.sh +++ b/deploy.sh @@ -94,15 +94,27 @@ coke update_version [ -e "tmp/dist" ] && rm -rf tmp/dist mkdir -p tmp/dist -# Collapse the serve trees into one directory +### Collapse the serve trees into one directory log "Collapsing serve trees..." + +# Copy the static files, derived files, and the whole data directory (bc lack of trailing /) +# into dist. Note that you will need to load all the site pages in your browser to populate var +# with the derived files. rsync -Ca static/ var/ data tmp/dist/ + +# We copy lib (which contains .co source files) to src to make it easy to link source content +# to each other. Finding it in gitweb is a pain. Finding it in gerrit is almost impossible. +# But this could go away when we move to github. rsync -Ca lib/ tmp/dist/src/ -# browserify -o tmp/dist/vendor/browserify.js -r events -r seq + +# For some reason, the shell tool does not generate a file identical to the middleware. So whatever. +# We curl here because we know that version works. curl --silent --fail --url http://$DEV_HOST/vendor/browserify.js > tmp/dist/vendor/browserify.js +# browserify -o tmp/dist/vendor/browserify.js -r events -r seq + log "ok!" -# Bundle Vendor JS Bundle +### Bundle Vendor JS Bundle target=tmp/dist/vendor/vendor-bundle.min.js log "Building Vendor Bundle ($target) ..." for js in $(coke source_list | grep vendor); do @@ -122,7 +134,8 @@ done log "ok!" -# Build App JS Bundle +### Build App JS Bundle + target=tmp/dist/js/kraken/app-bundle uglifyjs=$(which uglifyjs || echo "node_modules/uglify-js/bin/uglifyjs") log "Building App JS Bundle (${target}.js) ..." @@ -134,15 +147,17 @@ log "ok!" # TODO: bundle CSS -# Finally, deploy the files +### Finally, deploy the files log "Deploying files..." -# fix ownership and permissions before and after rsync. + +# Fix ownership and permissions before and after rsync. fix_permissions log "rsync -Caz $VERBOSE $DRY_RUN tmp/dist $DEPLOY_HOST:$DEPLOY_PATH" rsync -Crz $VERBOSE $DRY_RUN tmp/dist $DEPLOY_HOST:$DEPLOY_PATH fix_permissions log "ok!" +### Inform Supervisor to restart Node if [ "$RESTART_SERVER" ]; then log "Restarting Reportcard Server post-deploy..." log "ssh -t $DEPLOY_HOST 'sudo supervisorctl restart reportcard'"