forked from tschaub/suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
103 lines (84 loc) · 3.05 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# -*- mode: ruby -*-
# vi: set ft=ruby :
# INSTRUCTIONS
# 1. Install virtualbox on your local machine
# 2. Install vagrant on your local machine
# 3. Make sure this repo is up-to-date and on the correct fork/branch.
# 4. `git submodule update --init --recursive`
# 3. `vagrant up`
# 4. When finished building (more than an hour), `vagrant ssh`.
# The src directory is in /vagrant
# The build output is in build_output.txt
# 5. To build again from the VM do `~/build`
# To build again from the host do `vagrant ssh -c build`
Vagrant.configure(2) do |config|
config.vm.provider :virtualbox do |vb, override|
override.vm.box = 'ubuntu/trusty64'
# Adjust these settings as needed.
vb.memory = 4048
vb.cpus = 2
end
config.vm.provider :aws do |aws, override|
override.vm.box = 'dummy'
override.vm.box_url = 'https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box'
aws.ami = "ami-d05e75b8"
aws.instance_type = 'c3.2xlarge'
aws.block_device_mapping = [
{
'DeviceName' => '/dev/sda1',
'Ebs.VolumeSize' => 30,
},
{
'DeviceName' => '/dev/sdb',
'VirtualName' => 'ephemeral0',
},
{
'DeviceName' => '/dev/sdc',
'VirtualName' => 'ephemeral1',
},
]
aws.tags = {
'Name' => "#{$AWS_KEYPAIR_NAME}-suite-build-vagrant"
}
override.ssh.username = 'ubuntu'
override.vm.synced_folder '.', '/vagrant', disabled: true
override.vm.synced_folder '.', '/mnt/vagrant', type: 'rsync' #, rsync__exclude: '.git/'
end
# Share host's maven cache. Comment the following line to disable.
#config.vm.synced_folder '~/.m2', '/home/vagrant/.m2'
config.vm.provision :shell, privileged: false, inline: <<SCRIPT
export sudo DEBIAN_FRONTEND=noninteractive
sudo apt-get update
# sudo apt-get install -y git
# sudo mkdir /vagrant
# sudo chown ubuntu /vagrant
# git clone https://github.com/boundlessgeo/suite.git /vagrant
# cd /vagrant
# git submodule update --init --recursive
# cd ~
wget --no-check-certificate https://github.com/aglover/ubuntu-equip/raw/master/equip_java7_64.sh && bash equip_java7_64.sh
sudo apt-get -y install default-jdk
sudo apt-get -y install maven ant ivy
sudo ln -s /usr/share/java/ivy.jar /usr/share/ant/lib/ivy.jar
sudo apt-get -y install python-setuptools
sudo easy_install jstools
sudo apt-get -y install python-pip python-dev
sudo pip install -U Sphinx
# the standard ubuntu node install doesnt work very well and is VERY old. Use this one instead
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g bower
sudo npm install -g grunt-cli
sudo npm install -g gulp
sudo apt-get -y install gdal-bin ### Do we need one from our own repo?
if [ ! -d /vagrant ]; then
sudo ln -s /mnt/vagrant /vagrant
fi
echo """#!/bin/bash
cd /vagrant
echo 'Starting build.'
(ant -v 2>&1) | tee build_output.txt""" > ~/build
chmod a+rx ~/build
~/build
SCRIPT
end