# in a secure environment using trusted media (see the manual) but
# you can use this default if you like...
baseboxurl = "https://f-droid.org/jessie32.box"
+# or if you have a cached local copy, you can use that first:
+# baseboxurl = ["file:///home/fdroid/fdroidserver/cache/jessie32.box", "https://f-droid.org/jessie32.box"]
# The amount of RAM the build server will have
memory = 3584
help="Spew out even more information than normal")
parser.add_option("-c", "--clean", action="store_true", default=False,
help="Build from scratch, rather than attempting to update the existing server")
+parser.add_option("--debian-mirror", default="http://ftp.uk.debian.org/debian/",
+ help="Use the specified Debian mirror in the box's /etc/apt/sources.list.")
options, args = parser.parse_args()
config = {}
wanted.append(f)
+# allow specifying a list/tuple that includes cached local copy
+if type(config['baseboxurl']) in (list, tuple) or config['baseboxurl'][0] in ('(', '['):
+ baseboxurl = config['baseboxurl']
+else:
+ baseboxurl = '"{0}"'.format(config['baseboxurl'])
# Generate an appropriate Vagrantfile for the buildserver, based on our
# settings...
end
config.vm.box = "{0}"
- config.vm.box_url = "{1}"
+ config.vm.box_url = {1}
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", "{2}"]
config.vm.provision :shell, :path => "fixpaths.sh"
""".format(config['basebox'],
- config['baseboxurl'],
+ baseboxurl,
config['memory'],
config.get('cpus', 1))
if 'aptproxy' in config and config['aptproxy']:
vagrantfile += """
config.vm.provision :shell, :inline => 'sudo echo "Acquire::http {{ Proxy \\"{0}\\"; }};" > /etc/apt/apt.conf.d/02proxy && sudo apt-get update'
""".format(config['aptproxy'])
+
vagrantfile += """
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
:settings => {
:sdk_loc => "/home/vagrant/android-sdk",
:ndk_loc => "/home/vagrant/android-ndk",
+ :debian_mirror => "%s",
:user => "vagrant"
}
}
chef.add_recipe "kivy"
end
end
-"""
+""" % (options.debian_mirror)
# Check against the existing Vagrantfile, and if they differ, we need to
# create a new box: