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

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

# 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"
DISTRIBUTION = "buster"

# 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
  return "tails-builder-#{ARCHITECTURE}-#{DISTRIBUTION}-#{date}-#{shortid}"
end