Skip to content

Instantly share code, notes, and snippets.

@josch
Created August 28, 2018 11:09
Show Gist options
  • Save josch/cc2ece1e8adfe2f2e559a4da6dd12fe6 to your computer and use it in GitHub Desktop.
Save josch/cc2ece1e8adfe2f2e559a4da6dd12fe6 to your computer and use it in GitHub Desktop.
Setting up phenotips on Ubuntu Xenial with Tomcat
#!/bin/sh
set -exu
directory=ubuntu-xenial-robot
debootstrap --variant=minbase --include=dbus,systemd-sysv xenial "$directory" http://archive.ubuntu.com/ubuntu/
systemd-nspawn --boot --resolv-conf=copy-host --directory="$directory" &
pid=$!
sleep 10 # wait for the system to boot
machinectl shell "$directory" /bin/sh -c "
set -exu
apt update
apt install --yes tomcat8
mkdir /var/lib/phenotips
chown -R tomcat8:tomcat8 /var/lib/phenotips
"
mkdir "$directory"/var/lib/tomcat8/webapps/phenotips
if [ ! -e phenotips-war-1.3.7.war ]; then
curl https://nexus.phenotips.org/nexus/content/repositories/releases/org/phenotips/phenotips-war/1.3.7/phenotips-war-1.3.7.war > phenotips-war-1.3.7.war
fi
echo 0f1b9e1bea6ad479e46a6fbda253ad45 phenotips-war-1.3.7.war | md5sum --check
unzip -d "$directory"/var/lib/tomcat8/webapps/phenotips phenotips-war-1.3.7.war
machinectl poweroff "$directory"
wait $pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment