mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Fix problem with read rights on remote build machine
This commit is contained in:
parent
288c5f4c57
commit
a8e5c2d6e4
1 changed files with 6 additions and 2 deletions
|
@ -131,16 +131,20 @@ class RemoteBuildServer(BuildServer):
|
||||||
self.ssh_process.wait()
|
self.ssh_process.wait()
|
||||||
|
|
||||||
def download(self, src, dst):
|
def download(self, src, dst):
|
||||||
|
# Make sure we can read the file as {user}
|
||||||
|
self._remote_command(['sudo', 'chown', self.username, src])
|
||||||
src_arg = '{user}@{host}:{path}'.format(user=self.username, host=self.address, path=src)
|
src_arg = '{user}@{host}:{path}'.format(user=self.username, host=self.address, path=src)
|
||||||
log_check_call(['scp', '-i', self.keyfile, '-P', str(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):
|
||||||
|
self._remote_command(['sudo', 'rm', path])
|
||||||
|
|
||||||
|
def _remote_command(self, command):
|
||||||
ssh_cmd = ['ssh', '-i', self.keyfile,
|
ssh_cmd = ['ssh', '-i', self.keyfile,
|
||||||
'-p', str(self.port),
|
'-p', str(self.port),
|
||||||
self.username + '@' + self.address,
|
self.username + '@' + self.address,
|
||||||
'--',
|
'--'] + command
|
||||||
'sudo', 'rm', path]
|
|
||||||
log_check_call(ssh_cmd)
|
log_check_call(ssh_cmd)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue