forked from amalgam8/amalgam8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
100 lines (82 loc) · 3.66 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
#
# Copyright 2016 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This Vagrantfile sets up a development environment for building Amalgam8 components and examples.
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
set -x
apt-get update -qq
apt-get install -q -y curl python-pip jq
pip install -U setuptools
# Install and run Docker
echo deb http://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list
apt-key adv --keyserver pgp.mit.edu --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
apt-get update
sudo wget -qO- https://get.docker.com/ | sh
sudo usermod -a -G docker vagrant # Add vagrant user to the docker group
# Install docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.5.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Install golang
cd /tmp
curl -O https://storage.googleapis.com/golang/go1.7.1.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.7.1.linux-amd64.tar.gz
if ! grep -Fq "/home/vagrant/sandbox" /home/vagrant/.profile; then
echo 'export GOPATH=/home/vagrant/sandbox' >> /home/vagrant/.profile
fi
if ! grep -Fq "/usr/local/go/bin" /home/vagrant/.profile; then
echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> /home/vagrant/.profile
fi
#mkdir -p /home/vagrant/sandbox/src/github.com/amalgam8
#git clone https://github.com/amalgam8/amalgam8 /home/vagrant/sandbox/src/github.com/amalgam8/amalgam8
#git clone https://github.com/amalgam8/a8ctl /home/vagrant/sandbox/src/github.com/amalgam8/a8ctl
chown -R vagrant:vagrant /home/vagrant/sandbox
SCRIPT
Vagrant.configure('2') do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "..", "/home/vagrant/sandbox/src/github.com/amalgam8/amalgam8"
if FileTest::directory?("../../a8ctl")
config.vm.synced_folder "../../a8ctl", "/home/vagrant/sandbox/src/github.com/amalgam8/a8ctl"
end
config.vm.provider :virtualbox do |vb|
#vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ['modifyvm', :id, '--memory', '4096']
vb.cpus = 2
end
# Port mappings for various services inside the VM
####A8 Console
config.vm.network "forwarded_port", guest: 31000, host: 31000
####Controller
config.vm.network "forwarded_port", guest: 31200, host: 31200
####Registry
config.vm.network "forwarded_port", guest: 31300, host: 31300
####Gateway
config.vm.network "forwarded_port", guest: 32000, host: 32000
####Elasticsearch
config.vm.network "forwarded_port", guest: 30200, host: 30200
####Kibana
config.vm.network "forwarded_port", guest: 30500, host: 30500
####Weave Scope
config.vm.network "forwarded_port", guest: 30040, host: 30040
####Marathon Dashboard/Kubernetes dashboard
config.vm.network "forwarded_port", guest: 8080, host: 38080
####Mesos dashboard
config.vm.network "forwarded_port", guest: 35050, host: 35050
# Create a private network, which allows host-only access to the machine
# using a specific IP. For Marathon only.
#config.vm.network "private_network", ip: "192.168.33.33/24"
config.vm.provision :shell, inline: $script
end