From b81177b4a210201a51b13fe4dce668ad2e3cc2ae Mon Sep 17 00:00:00 2001 From: Aiko Mastboom Date: Thu, 9 May 2013 12:28:21 +0200 Subject: [PATCH] added lib caching, deployit script --- deployit | 3 +++ installit | 12 +++++++++- package.json | 68 +++++++++++++++++++++++++++------------------------- 3 files changed, 49 insertions(+), 34 deletions(-) mode change 100644 => 100755 deployit diff --git a/deployit b/deployit old mode 100644 new mode 100755 index e69de29..09a6bc4 --- a/deployit +++ b/deployit @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +fleet-deploy && fleet-exec -- npm --cache-min=99999 install && fleet-exec npm rebuild bson && fleet-spawn npm start diff --git a/installit b/installit index 90733c2..ee5fae1 100755 --- a/installit +++ b/installit @@ -20,7 +20,6 @@ set +e head ./node_modules/bson/ext/bson.h | grep "#define USE_MISALIGNED_MEMORY_ACCESS 1" rebuild_bson=$? set -e -echo rebuild_bson $rebuild_bson arch=`uname -m` if [[ "${arch}" == 'armv6l' && "${rebuild_bson}" == 0 ]]; then # ARM support: https://github.com/mongodb/js-bson/issues/37 @@ -39,6 +38,12 @@ if [ ! -f ./node_modules/share/webclient/share.js_orig ]; then ${SED} -e s/removeListener/removeEventListener/g ./node_modules/share/webclient/share-ace.js ${SED} -e s/removeListener/removeEventListener/g ./node_modules/share/webclient/share.uncompressed.js fi + +if [[ -d ${HOME}/.prototyper-cache/lib && ! -d ./public/lib ]];then + mkdir -p ./public/lib + cp -r ${HOME}/.prototyper-cache/lib ./public +fi + # Knockout mkdir -p ./public/lib/knockout cd ./public/lib/knockout @@ -138,6 +143,11 @@ if [ ! -f ./less-1.3.3.min.js ]; then fi cd ${current_dir} +if [ ! -d ${HOME}/.prototyper-cache/lib ];then + mkdir -p ${HOME}/.prototyper-cache + cp -r ./public/lib ${HOME}/.prototyper-cache +fi + if [[ "${arch}" == 'armv6l' && ! -d ./node_modules/bson/build ]]; then echo "need to rebuild bson: 'npm rebuild bson' before running" fi diff --git a/package.json b/package.json index 525307f..e6d28a2 100644 --- a/package.json +++ b/package.json @@ -1,35 +1,37 @@ { - "name": "Prototyper", - "version": "0.0.1", - "main": "server.js", - "engine": "node 0.10.4", - "private": "true", - "dependencies": { - "share": "~0.6.0", - "connect": "~2.7.6", - "express": "~3.2.0", - "bson": "~0.1.8", - "mongodb": "~1.2.14", - "handlebars": "~1.0.10", - "underscore": "~1.4.4", - "less": "~1.3.3", - "when": "~2.0.1", - "markdown": "~0.4.0", - "async": "~0.2.7" - }, - "devDependencies": { - "sockjs": "~0.3.5" - }, - "repository": "git://github.com/aikomastboom/Prototyper.git", - "author": "Aiko Mastboom", - "license": "Unknown", - "readmeFilename": "README.md", - "directories": { - "test": "test" - }, - "description": "README.md", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "install": "./installit" - } + "name": "Prototyper", + "version": "0.0.1", + "main": "server.js", + "engine": "node 0.10.4", + "private": "true", + "dependencies": { + "share": "~0.6.0", + "connect": "~2.7.6", + "express": "~3.2.0", + "bson": "~0.1.8", + "mongodb": "~1.2.14", + "handlebars": "~1.0.10", + "underscore": "~1.4.4", + "less": "~1.3.3", + "when": "~2.0.1", + "markdown": "~0.4.0", + "async": "~0.2.7" + }, + "devDependencies": { + "sockjs": "~0.3.5" + }, + "repository": "git://github.com/aikomastboom/Prototyper.git", + "author": "Aiko Mastboom", + "license": "Unknown", + "readmeFilename": "README.md", + "directories": { + "test": "test" + }, + "description": "README.md", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "install": "./installit", + "deploy": "./deployit" + + } }