Skip to content

Commit

Permalink
first pass at using non-interactive installer with vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
pameyer committed Apr 28, 2017
1 parent df67463 commit 8b3a080
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions scripts/vagrant/install-dataverse.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
if [ -n "$1" ]; then
MAILSERVER_ARG="--mailserver $1"
#!/usr/bin/env bash
if [ ! -z "$1" ]; then
MAILSERVER=$1
MAILSERVER_ARG="--mailserver $MAILSERVER"
fi
WAR=/dataverse/target/dataverse*.war
if [ ! -f $WAR ]; then
Expand All @@ -10,5 +11,20 @@ if [ ! -f $WAR ]; then
su $SUDO_USER -s /bin/sh -c "cd /dataverse && mvn package"
fi
cd /dataverse/scripts/installer
./install --hostname localhost $MAILSERVER_ARG --gfdir /home/glassfish/glassfish4 -y --force

# move any pre-existing `default.config` file out of the way to avoid overwriting
pid=$$
if [ -e default.config ]; then
mv default.config tmp-${pid}-default.config
fi
echo "HOST_DNS_ADDRESS localhost" > default.config
echo "GLASSFISH_DIRECTORY /home/glassfish/glassfish4" >> default.config
if [ ! -z "$MAILSERVER" ]; then
echo "MAIL_SERVER $MAILSERVER" >> default.config
fi
./install -y -f
if [ -e tmp-${pid}-default.config ]; then # if we moved it out, move it back
mv -f tmp-${pid}-default.config default.config
fi

echo "If "vagrant up" was successful (check output above) Dataverse is running on port 8080 of the Linux machine running within Vagrant, but this port has been forwarded to port 8888 of the computer you ran "vagrant up" on. For this reason you should go to http://localhost:8888 to see the Dataverse app running."

0 comments on commit 8b3a080

Please sign in to comment.