Last active
January 26, 2018 02:37
-
-
Save nitind/5352c4409322c6fdd4f85f77588b311b to your computer and use it in GitHub Desktop.
Vagrantfile for building WTP Source Editing under xenial64 against only the easily installable Java runtimes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$pvn = <<SCRIPT | |
add-apt-repository ppa:webupd8team/java -y | |
apt-get -y update | |
apt-get -y upgrade | |
### Java installation | |
echo "===> Add webupd8 repository..." | |
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list | |
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list | |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 | |
echo "===> install Oracle Java 8" | |
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections | |
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive | |
apt-get install -yq --no-install-recommends git build-essential java-common oracle-java8-installer oracle-java8-set-default maven openjdk-8-jdk | |
apt-get clean | |
update-java-alternatives -s java-8-oracle | |
# Prep and build the Xvnc server | |
apt-get -yq install --no-install-recommends xutils-dev libz-dev libjpeg-dev libxmu-dev libxaw7-dev xorg | |
curl -OL http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10_unixsrc.tar.gz | |
chown -R vagrant.vagrant vnc_unixsrc tightvnc-1.3.10_unixsrc.tar.gz | |
tar xzf tightvnc-1.3.10_unixsrc.tar.gz | |
cd /home/vagrant/vnc_unixsrc | |
xmkmf | |
make World | |
cd /home/vagrant/vnc_unixsrc/Xvnc | |
./configure | |
make | |
sudo cp -v /home/vagrant/vnc_unixsrc/Xvnc/programs/Xserver/Xvnc /usr/local/bin/ | |
cd ~vagrant | |
mkdir -p ~vagrant/.m2 | |
cat > ~vagrant/.m2/toolchains.xml << TOOLCHAINS | |
<?xml version="1.0" encoding="UTF-8"?> | |
<toolchains> | |
<!-- JDK toolchains --> | |
<toolchain> | |
<type>jdk</type> | |
<provides> | |
<id>J2SE-1.3</id> | |
<version>1.3</version> | |
</provides> | |
<configuration> | |
<jdkHome>/usr/lib/jvm/java-8-openjdk-amd64/jre/</jdkHome> | |
</configuration> | |
</toolchain> | |
<toolchain> | |
<type>jdk</type> | |
<provides> | |
<id>J2SE-1.4</id> | |
<version>1.4</version> | |
</provides> | |
<configuration> | |
<jdkHome>/usr/lib/jvm/java-8-openjdk-amd64/jre/</jdkHome> | |
</configuration> | |
</toolchain> | |
<toolchain> | |
<type>jdk</type> | |
<provides> | |
<id>J2SE-1.5</id> | |
<version>1.5</version> | |
</provides> | |
<configuration> | |
<jdkHome>/usr/lib/jvm/java-8-openjdk-amd64/jre/</jdkHome> | |
</configuration> | |
</toolchain> | |
<toolchain> | |
<type>jdk</type> | |
<provides> | |
<id>JavaSE-1.6</id> | |
<version>1.6</version> | |
</provides> | |
<configuration> | |
<jdkHome>/usr/lib/jvm/java-8-openjdk-amd64/jre/</jdkHome> | |
</configuration> | |
</toolchain> | |
<toolchain> | |
<type>jdk</type> | |
<provides> | |
<id>JavaSE-1.7</id> | |
<version>1.7</version> | |
</provides> | |
<configuration> | |
<jdkHome>/usr/lib/jvm/java-8-openjdk-amd64/jre/</jdkHome> | |
</configuration> | |
</toolchain> | |
<toolchain> | |
<type>jdk</type> | |
<provides> | |
<id>JavaSE-1.8</id> | |
<version>1.8</version> | |
</provides> | |
<configuration> | |
<jdkHome>/usr/lib/jvm/java-8-openjdk-amd64/jre/</jdkHome> | |
</configuration> | |
</toolchain> | |
</toolchains> | |
TOOLCHAINS | |
cd /vagrant | |
if [ ! -d webtools.sourceediting ] ; then | |
git clone https://git.eclipse.org/r/sourceediting/webtools.sourceediting | |
fi | |
cd webtools.sourceediting | |
BUILD='mvn clean install -e --fail-at-end -Pintegration -V -B -Dmaven.test.skip=false -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Dsurefire.timeout=1800 -DskipWithIssues=false -f pom.xml -P bree-libs' | |
echo $BUILD > build.sh | |
chown -R vagrant.vagrant ~vagrant /vagrant | |
# Run Xvnc to provide a DISPLAY | |
# /usr/local/bin/Xvnc :453 -geometry 1440x1080 -depth 24 -ac -fp /usr/share/fonts/X11/misc & | |
# export DISPLAY=:453 | |
. build.sh | |
SCRIPT | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.provision "shell", inline: $pvn | |
config.vm.post_up_message = "/usr/local/bin/Xvnc :453 -geometry 1440x1080 -depth 24 -ac -fp /usr/share/fonts/X11/misc& ; export DISPLAY=:453" | |
config.vm.box = "ubuntu/xenial64" | |
config.vm.provider "virtualbox" do |vb| | |
config.vm.post_up_message = "mvn clean install -e -fae -Pintegration -V -B -Dmaven.test.skip=false -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Dsurefire.timeout=1800 -DskipWithIssues=false -f pom.xml -P bree-libs -fae" | |
vb.customize ["modifyvm", :id, "--natdnsproxy1", "off" ] | |
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "off" ] | |
vb.customize ["modifyvm", :id, "--memory", "4096"] | |
vb.customize ["modifyvm", :id, "--cpus", "1"] | |
end | |
# build | |
config.vm.define "wtpbuild" do |box| | |
box.vm.network "private_network", ip: "192.168.11.10" | |
box.vm.hostname = "wtpbuild" | |
box.vm.synced_folder ".", "/vagrant" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment