summaryrefslogtreecommitdiffstats
path: root/vagrant/Vagrantfile
blob: 7009c90576c5d5291e814290698a2e615f2825d1 (plain)
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# Tails: The Amnesic Incognito Live System
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Monkey-patched Vagrant!
$:.unshift File.expand_path('../lib', __FILE__)
require 'vagrant_version'
require 'vagrant_verified_download'
require 'tails_build_settings'

if ENV['TAILS_RAM_BUILD']
  mem_size = VM_MEMORY_FOR_RAM_BUILDS
else
  mem_size = VM_MEMORY_FOR_DISK_BUILDS
end

cpus = ENV['TAILS_BUILD_CPUS']

if vagrant_old
  Vagrant::Config.run do |config|
    config.vm.box = 'tails-builder-20141201'
    config.vm.box_url = 'http://dl.amnesia.boum.org/tails/project/vagrant/tails-builder-20141201.box'

    config.vm.provision :shell, :inline => "http_proxy='#{ENV['http_proxy']}' /vagrant/provision/setup-tails-builder"

   config.vm.share_folder 'amnesia', '/amnesia.git', '../.git'

   config.vm.customize ['modifyvm', :id, '--memory', mem_size]
   config.vm.customize ['modifyvm', :id, '--cpus', cpus] unless cpus.nil?
  end
else
  Vagrant.configure("2") do |config|
    config.vm.box = 'tails-builder-20141201'
    config.vm.box_url = 'http://dl.amnesia.boum.org/tails/project/vagrant/tails-builder-20141201.box'

    config.vm.provision "shell",
      inline: "sudo http_proxy='#{ENV['http_proxy']}' /vagrant/provision/setup-tails-builder"

    config.vm.synced_folder '../.git', '/amnesia.git'

    config.vm.provider :virtualbox do |vb|
      vb.customize ['modifyvm', :id, '--memory', mem_size]
      vb.customize ['modifyvm', :id, '--cpus', cpus] unless cpus.nil?
    end
  end
end