Skip to content

Instantly share code, notes, and snippets.

@Joshfindit
Last active November 5, 2015 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Joshfindit/7ccbb3b5e8d4440bcd17 to your computer and use it in GitHub Desktop.
Save Joshfindit/7ccbb3b5e8d4440bcd17 to your computer and use it in GitHub Desktop.
#!/bin/sh
#This is to be run on the ubuntu docker image
#screen HIGHLY suggested - The steps take a while (esp the apache archive downloads) and are not fault-tolerant
#create 8GB swap file
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
#Set swap file to mount on boot
sudo echo "/swapfile none swap sw 0 0" >> /etc/fstab
#Install node and npm
sudo apt-get update
sudo apt-get install nodejs npm nodejs-legacy
#Install Oracle Java 7. Thanks http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
#There is some discrepancy about whether it's 7 or 8. The Travis build runs against 7 on the last known pass, so let's use that
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
#installed maven 3.3
cd ~/; wget http://apache.mirror.gtcomm.net/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz; mkdir -p /usr/local/apache-maven/; tar -zxf apache-maven-3.3.3-bin.tar.gz -C /usr/local/apache-maven/; ln -s /usr/local/apache-maven/apache-maven-3.3.3/bin/mvn /usr/local/bin/mvn
#didn't install bower when making this script; should have?
npm install -g bower
#Buile the Visallo container
cd ~/; git clone https://github.com/v5analytics/visallo.git
cd ~/visallo
./docker/build-dev.sh
#do the maven build
echo "{" >> ~/.bowerrc
echo " allow-root:true" >> ~/.bowerrc
echo "}" >> ~/.bowerrc
mvn package -pl web/war -am -DskipTests -Dsource.skip=true
#This is where it gets fuzzy
#cp command from https://github.com/v5analytics/visallo/tree/master/docker, but the docker/visallo-dev-persistent folder doesn't exist
mkdir -p docker/visallo-dev-persistent/opt/jetty/webapps/ #?
cp web/war/target/visallo-web-war*.war docker/visallo-dev-persistent/opt/jetty/webapps/root.war
#user auth plugin
mvn package -pl ./web/plugins/auth-username-only -am -DskipTests
#again with deep cp commands with no directory
mkdir -p docker/visallo-dev-persistent/opt/visallo/lib #?
cp web/plugins/auth-username-only/target/visallo-web-auth-username-only-*[0-9T].jar docker/visallo-dev-persistent/opt/visallo/lib
echo "When you're inside the docker container, run '/opt/jetty/bin/jetty.sh start'"
./docker/run-dev.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment