simplify testing with diff postgres version (still need to sync this with vagrant_set...
authorGil Moskowitz <gmoskowitz@xtuple.com>
Wed, 17 Sep 2014 13:42:02 +0000 (09:42 -0400)
committerGil Moskowitz <gmoskowitz@xtuple.com>
Wed, 17 Sep 2014 13:42:02 +0000 (09:42 -0400)
scripts/install_xtuple.sh

index 72aab69..b8ae265 100644 (file)
@@ -139,7 +139,10 @@ install_packages() {
   sudo add-apt-repository -y "deb http://apt.postgresql.org/pub/repos/apt/ ${DEBDIST}-pgdg main"
   sudo wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
   sudo apt-get -qq update 2>&1 | tee -a $LOG_FILE
-  sudo apt-get -q -y install curl build-essential libssl-dev postgresql-9.1 postgresql-server-dev-9.1 postgresql-contrib-9.1 postgresql-9.1-plv8 2>&1 | tee -a $LOG_FILE
+  sudo apt-get -q -y install curl build-essential libssl-dev \
+    postgresql-${PG_VERSION} postgresql-server-dev-${PG_VERSION} \
+    postgresql-contrib-${PG_VERSION} postgresql-${PG_VERSION}-plv8 2>&1 \
+    | tee -a $LOG_FILE
 
   if [ ! -d "/usr/local/nvm" ]; then
     sudo rm -f /usr/local/bin/nvm
@@ -158,6 +161,7 @@ install_packages() {
        # npm no longer supports its self-signed certificates
        log "telling npm to use known registrars..."
        npm config set ca ""
+        sudo chown -R $USER $HOME/.npm
 
   log "installing npm modules..."
   npm install --unsafe-perm 2>&1 | tee -a $LOG_FILE
@@ -189,7 +193,7 @@ setup_postgres() {
                return 1
        fi
 
-       PGDIR=/etc/postgresql/9.1/main
+       PGDIR=/etc/postgresql/${PG_VERSION}/main
 
   log "copying configs..."
        sudo cp $PGDIR/postgresql.conf $PGDIR/postgresql.conf.default