then
return 1
fi
-
+
cdir $BASEDIR
if [ ! -d plv8js ]
then
else
log "Found /usr/src/v8"
fi
-
+
cdir $XT_DIR
# add remote
if [ -z "$(git remote -v | grep xtuple/xtuple.git)" ]
log "Adding xtuple remote"
su $SUDO_USER -c "git remote add --track master xtuple https://github.com/xtuple/xtuple.git"
fi
-
+
if [ $XT_VERSION ]
then
log "Checking out $XT_VERSION"
# 3. if not, see if we can download the pre-made deb package
# 4. if not, compile from source
# the source should be cloned whether we need to compile or not
-
+
cdir $RUN_DIR
-
+
log "Checking if nodejs is installed"
dpkg -s nodejs 2>1 > /dev/null
if [ $? -eq 0 ]
log "nodejs is installed."
else
log "nodejs is not installed"
-
+
log "Looking for nodejs_$NODE_VERSION.deb in $(pwd)"
if [ ! -f nodejs_$NODE_VERSION.deb ]
then
dpkg -i nodejs_$NODE_VERSION.deb 2>1 | tee -a $LOG_FILE
fi
fi
-
+
cdir $RUN_DIR
log "Checking if libv8 is installed"
dpkg -s libv8 2>1 > /dev/null
log "libv8 is installed"
else
log "libv8 is not installed."
-
+
log "Looking for libv8-3.16.5_3.16.5-1_amd64.deb in $(pwd)"
if [ -f libv8-3.16.5_3.16.5-1_amd64.deb ]
then
else
log "File not found."
log "Attempting to download $XTUPLE_REPO/libv8-3.16.5_3.16.5-1_amd64.deb"
-
+
wget -q $XTUPLE_REPO/libv8-3.16.5_3.16.5-1_amd64.deb && wait
if [ $? -ne 0 ]
then
fi
fi
fi
-
+
cdir $RUN_DIR
log "Checking if plv8js is installed."
dpkg -s postgresql-9.1-plv8 2>1 > /dev/null
log "plv8js is installed"
else
log "plv8js is not installed"
-
+
log "Looking for postgresql-9.1-plv8_1.4.0-1_amd64.deb in $(pwd)"
if [ ! -f postgresql-9.1-plv8_1.4.0-1_amd64.deb ]
then
then
return 1
fi
-
+
PGDIR=/etc/postgresql/9.1/main
mv $PGDIR/postgresql.conf $PGDIR/postgresql.conf.default
if [ $? -ne 0 ]
chown postgres $PGDIR/pg_hba.conf
service postgresql restart
-
+
log ""
log "Dropping old databases if they already exist..."
log ""
dropdb -U postgres dev
-
+
cdir $BASEDIR/postgres
wget http://sourceforge.net/api/file/index/project-id/196195/mtime/desc/limit/200/rss
wait
# Pull submodules
-pull_modules() {
+pull_modules() {
cdir $XT_DIR
git submodule update --init --recursive 2>1 | tee -a $LOG_FILE
if [ $? -ne 0 ]
log ""
psql -U postgres dev -c "select xt.js_init(); insert into xt.usrext (usrext_usr_username, usrext_ext_id) select 'admin', ext_id from xt.ext where ext_location = '/core-extensions';" 2>1 | tee -a $LOG_FILE
-
+
cdir $XT_DIR/node-datasource
cat sample_config.js | sed 's/bindAddress: "localhost",/bindAddress: "0.0.0.0",/' | sed 's/testDatabase: ""/testDatabase: "dev"/' > config.js
log ""
log "The database is now set up..."
log ""
-
+
mkdir -p $XT_DIR/node-datasource/lib/private
cdir $XT_DIR/node-datasource/lib/private
cat /dev/urandom | tr -dc '0-9a-zA-Z!@#$%^&*_+-'| head -c 64 > salt.txt
cdir $XT_DIR
node scripts/build_app.js -d dev 2>1 | tee -a $LOG_FILE
-
+
log ""
log "######################################################"
log "######################################################"