mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-03 17:50:11 +02:00
Fix non-cached buildserver build-tools install
This commit is contained in:
parent
6adc661e0e
commit
b5fd722911
@ -37,7 +37,7 @@ script "add_build_tools" do
|
||||
echo Installing from cache
|
||||
tar -C #{sdk_loc}/build-tools -z -x -f /vagrant/cache/build-tools/17.0.0.tar.gz
|
||||
else
|
||||
echo Need the right install filter for this
|
||||
#{sdk_loc}/tools/android update sdk --no-ui -a -t build-tools-17.0.0
|
||||
fi
|
||||
"
|
||||
not_if "test -d #{sdk_loc}/build-tools/17.0.0"
|
||||
|
@ -46,6 +46,22 @@ def get_builder_vm_id():
|
||||
v = json.load(vf)
|
||||
return v['active']['default']
|
||||
|
||||
def got_valid_builder_vm():
|
||||
"""Returns True if we have a valid-looking builder vm
|
||||
"""
|
||||
if not os.path.exists(os.path.join('builder', 'Vagrantfile')):
|
||||
return False
|
||||
vd = os.path.join('builder', '.vagrant')
|
||||
if not os.path.exists(vd):
|
||||
return False
|
||||
if not os.path.isdir(vd):
|
||||
# Vagrant 1.0 - if the directory is there, it's valid...
|
||||
return True
|
||||
# Vagrant 1.2 - the directory can exist, but the id can be missing...
|
||||
if not os.path.exists(os.path.join(vd, 'machines', 'default', 'virtualbox', 'id')):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
# Note that 'force' here also implies test mode.
|
||||
def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path, force):
|
||||
@ -57,8 +73,7 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path, force):
|
||||
vm_ok = False
|
||||
if not options.resetserver:
|
||||
print "Checking for valid existing build server"
|
||||
if (os.path.exists(os.path.join('builder', 'Vagrantfile')) and
|
||||
os.path.exists(os.path.join('builder', '.vagrant'))):
|
||||
if got_valid_builder_vm():
|
||||
print "...VM is present"
|
||||
p = subprocess.Popen(['VBoxManage', 'snapshot', get_builder_vm_id(), 'list', '--details'],
|
||||
cwd='builder', stdout=subprocess.PIPE)
|
||||
|
Loading…
Reference in New Issue
Block a user