mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-08 01:40:31 +00:00
Fix bugs in remote build server
This commit is contained in:
parent
ab18516f79
commit
09fee291a8
1 changed files with 9 additions and 7 deletions
|
@ -46,6 +46,8 @@ class BuildServer(object):
|
||||||
def apply_build_settings(self, manifest_data):
|
def apply_build_settings(self, manifest_data):
|
||||||
if manifest_data['provider']['name'] == 'virtualbox' and 'guest_additions' in manifest_data['provider']:
|
if manifest_data['provider']['name'] == 'virtualbox' and 'guest_additions' in manifest_data['provider']:
|
||||||
manifest_data['provider']['guest_additions'] = self.build_settings['guest_additions']
|
manifest_data['provider']['guest_additions'] = self.build_settings['guest_additions']
|
||||||
|
if 'apt_proxy' in self.build_settings:
|
||||||
|
manifest_data.get('plugins', {})['apt_proxy'] = self.build_settings['apt_proxy']
|
||||||
return manifest_data
|
return manifest_data
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,7 +77,7 @@ class RemoteBuildServer(BuildServer):
|
||||||
log.debug('Opening SSH connection')
|
log.debug('Opening SSH connection')
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
server_cmd = ['sudo', self.settings['server_bin'], '--listen', str(self.remote_server_port)]
|
server_cmd = ['sudo', self.server_bin, '--listen', str(self.remote_server_port)]
|
||||||
|
|
||||||
def set_process_group():
|
def set_process_group():
|
||||||
# Changes the process group of a command so that any SIGINT
|
# Changes the process group of a command so that any SIGINT
|
||||||
|
@ -85,8 +87,8 @@ class RemoteBuildServer(BuildServer):
|
||||||
os.setpgrp()
|
os.setpgrp()
|
||||||
|
|
||||||
addr_arg = '{user}@{host}'.format(user=self.username, host=self.address)
|
addr_arg = '{user}@{host}'.format(user=self.username, host=self.address)
|
||||||
ssh_cmd = ['ssh', '-i', self.settings['keyfile'],
|
ssh_cmd = ['ssh', '-i', self.keyfile,
|
||||||
'-p', str(self.settings['port']),
|
'-p', str(self.port),
|
||||||
'-L' + str(self.local_server_port) + ':localhost:' + str(self.remote_server_port),
|
'-L' + str(self.local_server_port) + ':localhost:' + str(self.remote_server_port),
|
||||||
'-R' + str(self.remote_callback_port) + ':localhost:' + str(self.local_callback_port),
|
'-R' + str(self.remote_callback_port) + ':localhost:' + str(self.local_callback_port),
|
||||||
addr_arg]
|
addr_arg]
|
||||||
|
@ -129,13 +131,13 @@ class RemoteBuildServer(BuildServer):
|
||||||
self.ssh_process.wait()
|
self.ssh_process.wait()
|
||||||
|
|
||||||
def download(self, src, dst):
|
def download(self, src, dst):
|
||||||
src_arg = '{user}@{host}:{path}'.format(self.username, self.address, src)
|
src_arg = '{user}@{host}:{path}'.format(user=self.username, host=self.address, path=src)
|
||||||
log_check_call(['scp', '-i', self.keyfile, '-P', self.port,
|
log_check_call(['scp', '-i', self.keyfile, '-P', str(self.port),
|
||||||
src_arg, dst])
|
src_arg, dst])
|
||||||
|
|
||||||
def delete(self, path):
|
def delete(self, path):
|
||||||
ssh_cmd = ['ssh', '-i', self.settings['keyfile'],
|
ssh_cmd = ['ssh', '-i', self.keyfile,
|
||||||
'-p', str(self.settings['port']),
|
'-p', str(self.port),
|
||||||
self.username + '@' + self.address,
|
self.username + '@' + self.address,
|
||||||
'--',
|
'--',
|
||||||
'sudo', 'rm', path]
|
'sudo', 'rm', path]
|
||||||
|
|
Loading…
Add table
Reference in a new issue