chiark / gitweb /
Tidy up/fix some vagrant issues
authorCiaran Gultnieks <ciaran@ciarang.com>
Tue, 26 Jan 2016 22:01:28 +0000 (22:01 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Tue, 26 Jan 2016 22:05:31 +0000 (22:05 +0000)
1. It is packaged in modern versions of distros, update docs accordingly
2. 1.1 is hopelessly outdated - support 1.4 onwards
3. Check the version properly, and write a better config (previously it
   wrote the 1.1 config for 1.1 and 1.3+
4. Ensure that the default share from later versions is not present when
   building, it's only required for provisioning.

docs/fdroid.texi
fdroidserver/build.py

index e57b4a12367e0616722663d30b1859a41ce10444..96545d73785774d5a6c3b50b8331d56bcf033b15 100644 (file)
@@ -117,7 +117,7 @@ VirtualBox (debian package virtualbox)
 @item
 Ruby (debian packages ruby and rubygems)
 @item
-Vagrant (unpackaged, tested on v1.4.3)
+Vagrant (debian package vagrant - 1.4.x or higher required)
 @item
 vagrant-cachier plugin (unpackaged): `vagrant plugin install vagrant-cachier`
 @item
index 463e60573abe4afff1ee088eb82ea75200194de7..021e1041910ce4398a480cada6cbb3a5efc1ddbc 100644 (file)
@@ -178,16 +178,15 @@ def get_clean_vm(reset=False):
 
         p = subprocess.Popen(['vagrant', '--version'],
                              stdout=subprocess.PIPE)
-        vver = p.communicate()[0]
+        vver = p.communicate()[0].strip().split(' ')[1]
+        if vver.split('.')[0] != '1' or int(vver.split('.')[1]) < 4:
+            raise BuildException("Unsupported vagrant version {0}".format(vver))
+
         with open(os.path.join('builder', 'Vagrantfile'), 'w') as vf:
-            if vver.startswith('Vagrant version 1.2'):
-                vf.write('Vagrant.configure("2") do |config|\n')
-                vf.write('config.vm.box = "buildserver"\n')
-                vf.write('end\n')
-            else:
-                vf.write('Vagrant::Config.run do |config|\n')
-                vf.write('config.vm.box = "buildserver"\n')
-                vf.write('end\n')
+            vf.write('Vagrant.configure("2") do |config|\n')
+            vf.write('config.vm.box = "buildserver"\n')
+            vf.write('config.vm.synced_folder ".", "/vagrant", disabled: true\n')
+            vf.write('end\n')
 
         logging.info("Starting new build server")
         retcode, _ = vagrant(['up'], cwd='builder')