chiark / gitweb /
makebuildserver: make copy_caches_from_host do rsync like `fdroid build`
authorHans-Christoph Steiner <hans@eds.org>
Wed, 6 Dec 2017 08:47:08 +0000 (09:47 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 6 Dec 2017 19:20:17 +0000 (20:20 +0100)
This rsync hung because of an SSH unknown key prompt.  Since this is just
the vm host sshing to the vm guest, it is not essential to check the host
keys.

fdroidserver/build.py
makebuildserver

index bbb5a2b4d0b2e7492210c1298f5ada9177e85b83..d83342d50e3b72a0ebaefa5f6dff9cf0be120401 100644 (file)
@@ -100,6 +100,7 @@ def build_server(app, build, vcs, build_dir, output_dir, log_dir, force):
         # Helper to copy the contents of a directory to the server...
         def send_dir(path):
             logging.debug("rsyncing " + path + " to " + ftp.getcwd())
+            # TODO this should move to `vagrant rsync` from >= v1.5
             try:
                 subprocess.check_output(['rsync', '--recursive', '--perms', '--links', '--quiet', '--rsh=' +
                                          'ssh -o StrictHostKeyChecking=no' +
index 7ce2e62d1a4842a29fb3c2dae642a111e20de92d..b453d813ecd550f7054563686fa1620bea97f5fd 100755 (executable)
@@ -553,10 +553,16 @@ def main():
         for d in ('.m2', '.gradle/caches', '.gradle/wrapper', '.pip_download_cache'):
             fullpath = os.path.join(os.getenv('HOME'), d)
             if os.path.isdir(fullpath):
-                # TODO newer versions of vagrant provide `vagrant rsync`
+                ssh_command = ' '.join('ssh -i {0} -p {1}'.format(key, port),
+                                       '-o StrictHostKeyChecking=no',
+                                       '-o UserKnownHostsFile=/dev/null',
+                                       '-o LogLevel=FATAL',
+                                       '-o IdentitiesOnly=yes',
+                                       '-o PasswordAuthentication=no')
+                # TODO vagrant 1.5+ provides `vagrant rsync`
                 run_via_vagrant_ssh(v, ['cd ~ && test -d', d, '|| mkdir -p', d])
                 subprocess.call(['rsync', '-axv', '--progress', '--delete', '-e',
-                                 'ssh -i {0} -p {1} -oIdentitiesOnly=yes'.format(key, port),
+                                 ssh_command,
                                  fullpath + '/',
                                  user + '@' + hostname + ':~/' + d + '/'])