mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	buildserver: move config to buildserver/Vagrantfile.yaml
This commit is contained in:
		
							parent
							
								
									e2fcd633fc
								
							
						
					
					
						commit
						abf535aabe
					
				
					 3 changed files with 44 additions and 40 deletions
				
			
		
							
								
								
									
										26
									
								
								buildserver/Vagrantfile
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								buildserver/Vagrantfile
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -1,13 +1,22 @@
 | 
			
		|||
require 'yaml'
 | 
			
		||||
require 'pathname'
 | 
			
		||||
 | 
			
		||||
configfile = {
 | 
			
		||||
  'boot_timeout' => 600,
 | 
			
		||||
  'cachedir' => File.join(ENV['HOME'], '.cache', 'fdroidserver'),
 | 
			
		||||
  'cpus' => 1,
 | 
			
		||||
  'debian_mirror' => 'https://deb.debian.org/debian/',
 | 
			
		||||
  'hwvirtex' => 'on',
 | 
			
		||||
  'memory' => 2048,
 | 
			
		||||
  'vm_provider' => 'virtualbox',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
srvpath = Pathname.new(File.dirname(__FILE__)).realpath
 | 
			
		||||
configpath = File.join(srvpath, "/Vagrantfile.yaml")
 | 
			
		||||
if File.exists? configpath
 | 
			
		||||
  configfile = YAML.load_file(configpath)
 | 
			
		||||
else
 | 
			
		||||
  puts "#{configpath} does not exist, run ./makebuildserver?"
 | 
			
		||||
  configfile = Hash.new
 | 
			
		||||
  YAML.load_file(configpath).each do |k,v|
 | 
			
		||||
    configfile[k] = v
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Vagrant.configure("2") do |config|
 | 
			
		||||
| 
						 | 
				
			
			@ -62,12 +71,9 @@ Vagrant.configure("2") do |config|
 | 
			
		|||
      args: [configfile["aptproxy"]]
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # buildserver/ is shared to the VM's /vagrant by default so the old
 | 
			
		||||
  # default does not need a custom mount
 | 
			
		||||
  if configfile["cachedir"] != "buildserver/cache"
 | 
			
		||||
    config.vm.synced_folder configfile["cachedir"], '/vagrant/cache',
 | 
			
		||||
      create: true, type: synced_folder_type
 | 
			
		||||
  end
 | 
			
		||||
  config.vm.synced_folder configfile["cachedir"], '/vagrant/cache',
 | 
			
		||||
                          create: true, type: synced_folder_type
 | 
			
		||||
 | 
			
		||||
  # Make sure dir exists to mount to, since buildserver/ is
 | 
			
		||||
  # automatically mounted as /vagrant in the guest VM. This is more
 | 
			
		||||
  # necessary with 9p synced folders
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue