summaryrefslogtreecommitdiff
path: root/contractor
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-04-09 11:06:50 +0300
committerLars Wirzenius <liw@liw.fi>2020-04-09 11:06:50 +0300
commit95625472c0cda297413cdb9fb2294c73f0e909da (patch)
tree0b3b07c9ba94553008880c2aaf80b1126e8394fb /contractor
parent072e8f1277ec5de91d49f7a855cd7e2ae09f2962 (diff)
downloadick-contractor-95625472c0cda297413cdb9fb2294c73f0e909da.tar.gz
Change: upload workspace
Diffstat (limited to 'contractor')
-rwxr-xr-xcontractor19
1 files changed, 9 insertions, 10 deletions
diff --git a/contractor b/contractor
index 666736f..03ed7ea 100755
--- a/contractor
+++ b/contractor
@@ -31,7 +31,7 @@ def ssh(target, argv, quiet=False):
def rsync(filename, target):
- argv = ['rsync', '-aHSs', '--', filename, target]
+ argv = ['rsync', '-aHSs', '--delete', '--', filename, target]
logging.info('RSYNC: {!r}'.format(argv))
return subprocess.call(argv, stderr=STDOUT, stdout=None)
@@ -90,15 +90,10 @@ class ContractorApplication(cliapp.Application):
else:
self.verbose('no packages to install')
- # if pkgs:
- # self.cmd_setup(
- # ['env', 'DEBIAN_INTERFACE=noninteractive',
- # 'apt-get', 'install', '-y'] + pkgs)
-
- # workspace = os.path.expanduser(build['workspace'])
- # if workspace and os.path.isdir(workspace):
- # self.verbose('Uploading saved workspace from {}'.format(workspace))
- # self.cmd_put_workspace([workspace])
+ ws = bs.workspace()
+ if ws and os.path.exists(ws):
+ self.verbose('upload saved workspace from {}'.format(ws))
+ w.upload_workspace(ws)
# source = os.path.expanduser(build['source'])
# self.verbose('Uploading source code from {}'.format(source))
@@ -496,5 +491,9 @@ class Worker:
'apt-get', '-y', 'install'] + pkgs)
return exit_code
+ def upload_workspace(self, dirname):
+ return rsync(
+ '{}/.'.format(dirname), '{}/workspace/.'.format(self._target))
+
ContractorApplication().run()