2015-01-09 02:21:13 -05:00
|
|
|
installDeps() {
|
2015-01-09 02:43:12 -05:00
|
|
|
sudo apt-get update
|
2015-01-11 06:38:20 -05:00
|
|
|
sudo apt-get install -y maven
|
2015-01-09 02:43:12 -05:00
|
|
|
sudo apt-get install -y openjdk-7-jdk
|
|
|
|
sudo update-alternatives --set java /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
|
|
|
|
sudo update-alternatives --set javac /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/javac
|
2015-01-09 02:21:13 -05:00
|
|
|
return 1
|
|
|
|
}
|
2015-01-09 02:52:49 -05:00
|
|
|
|
2015-01-10 04:07:37 -05:00
|
|
|
command -v mvn >/dev/null 2>&1 && command -v /usr/lib/jvm/java-7-openjdk-amd64/bin/javac >/dev/null 2>&1 || installDeps
|
2015-01-11 12:38:31 -05:00
|
|
|
mvn package &&\
|
2015-01-10 07:54:06 -05:00
|
|
|
sudo cp ./target/writelatex-git-bridge-1.0-SNAPSHOT-jar-with-dependencies.jar /usr/local/sbin/writelatex-git-bridge.jar &&\
|
2015-01-09 02:52:49 -05:00
|
|
|
sudo cp ./bin/wlgb /etc/init.d/ &&\
|
|
|
|
sudo mkdir -p /var/log/wlgb &&\
|
|
|
|
sudo mkdir -p /etc/wlgb &&\
|
|
|
|
if [ ! -f /etc/wlgb/config.json ]; then
|
|
|
|
sudo cp ./bin/config.json /etc/wlgb/
|
|
|
|
fi &&\
|
|
|
|
sudo /usr/sbin/update-rc.d -f wlgb defaults
|