mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 07:20:29 +03:00
This seems to be a more stable snapshot creation
This commit is contained in:
parent
80edc5d79b
commit
7e73b40b20
1 changed files with 20 additions and 0 deletions
|
|
@ -83,10 +83,30 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, sdk_path):
|
||||||
print "Starting new build server"
|
print "Starting new build server"
|
||||||
if subprocess.call(['vagrant', 'up'], cwd='builder') != 0:
|
if subprocess.call(['vagrant', 'up'], cwd='builder') != 0:
|
||||||
raise BuildException("Failed to start build server")
|
raise BuildException("Failed to start build server")
|
||||||
|
|
||||||
|
# Open SSH connection to make sure it's working and ready...
|
||||||
|
print "Connecting to virtual machine..."
|
||||||
|
subprocess.call('vagrant ssh-config >sshconfig',
|
||||||
|
cwd='builder', shell=True)
|
||||||
|
vagranthost = 'default' # Host in ssh config file
|
||||||
|
sshconfig = ssh.SSHConfig()
|
||||||
|
sshf = open('builder/sshconfig', 'r')
|
||||||
|
sshconfig.parse(sshf)
|
||||||
|
sshf.close()
|
||||||
|
sshconfig = sshconfig.lookup(vagranthost)
|
||||||
|
sshs = ssh.SSHClient()
|
||||||
|
sshs.set_missing_host_key_policy(ssh.AutoAddPolicy())
|
||||||
|
sshs.connect(sshconfig['hostname'], username=sshconfig['user'],
|
||||||
|
port=int(sshconfig['port']), timeout=60, look_for_keys=False,
|
||||||
|
key_filename=sshconfig['identityfile'])
|
||||||
|
|
||||||
print "Saving clean state of new build server"
|
print "Saving clean state of new build server"
|
||||||
if subprocess.call(['vagrant', 'snap', 'take', '-n', 'fdroidclean'],
|
if subprocess.call(['vagrant', 'snap', 'take', '-n', 'fdroidclean'],
|
||||||
cwd='builder') != 0:
|
cwd='builder') != 0:
|
||||||
raise BuildException("Failed to take snapshot")
|
raise BuildException("Failed to take snapshot")
|
||||||
|
print "Restarting new build server"
|
||||||
|
if subprocess.call(['vagrant', 'up'], cwd='builder') != 0:
|
||||||
|
raise BuildException("Failed to start build server")
|
||||||
# Make sure it worked...
|
# Make sure it worked...
|
||||||
p = subprocess.Popen(['vagrant', 'snap', 'list'],
|
p = subprocess.Popen(['vagrant', 'snap', 'list'],
|
||||||
cwd='builder', stdout=subprocess.PIPE)
|
cwd='builder', stdout=subprocess.PIPE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue