summaryrefslogtreecommitdiffstats
path: root/vagrant/lib/tails_build_settings.rb
blob: 1260cbadff38545b650b8587bae4871230bc0982 (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
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Hostname of the virtual machine (must be in /etc/hosts)
VIRTUAL_MACHINE_HOSTNAME = 'vagrant-buster'.freeze

# Approximate amount of RAM needed to run the builder's base system
# and perform a build
VM_MEMORY_BASE = 1.5 * 1024

# Approximate amount of extra space needed for builds
BUILD_SPACE_REQUIREMENT = 12 * 1024

# Virtual machine memory size for on-disk builds
VM_MEMORY_FOR_DISK_BUILDS = VM_MEMORY_BASE

# Virtual machine memory size for in-memory builds
VM_MEMORY_FOR_RAM_BUILDS = VM_MEMORY_BASE + BUILD_SPACE_REQUIREMENT

# The builder VM's platform
ARCHITECTURE = 'amd64'.freeze
DISTRIBUTION = 'buster'.freeze

# The name of the Vagrant box
def box_name
  git_root = `git rev-parse --show-toplevel`.chomp
  shortid, date = `git log -1 --date="format:%Y%m%d" --pretty="%h %ad" -- \
                   #{git_root}/vagrant/`.chomp.split
  "tails-builder-#{ARCHITECTURE}-#{DISTRIBUTION}-#{date}-#{shortid}"
end