From 8a6b280d86cc757b114b19c25c0479cc5070ec5e Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sat, 4 Jan 2020 14:24:54 +0100 Subject: [PATCH] Use an ssh config file to configure package uploading [skip ci] --- scripts/appveyor.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/appveyor.py b/scripts/appveyor.py index dfaafa37..dfb42d78 100755 --- a/scripts/appveyor.py +++ b/scripts/appveyor.py @@ -497,7 +497,7 @@ def setup_ssh(): # Write SSH Private Key file from environment variable pkey = pkey.replace(' ', '\n') - with (opt.clone_dir / 'id_rsa').open('w') as f: + with (opt.clone_dir / 'data/id_rsa-psycopg-upload').open('w') as f: f.write( f"""\ -----BEGIN RSA PRIVATE KEY----- @@ -516,16 +516,11 @@ def upload_packages(): # Upload built artifacts logger.info("uploading artifacts") - ssh_cmd = ( - r"C:\MinGW\msys\1.0\bin\ssh -i %s " - "-o UserKnownHostsFile=%s -o StrictHostKeyChecking=yes" - % (opt.clone_dir / "id_rsa", opt.clone_dir / 'known_hosts') - ) - - os.chdir(opt.package_dir) + os.chdir(opt.clone_dir) run_command( [r"C:\MinGW\msys\1.0\bin\rsync", "-avr"] - + ["-e", ssh_cmd, "dist/", "psycopg@upload.psycopg.org:"] + + ["-e", r"C:\MinGW\msys\1.0\bin\ssh -F data/ssh_config"] + + ["psycopg2/dist/", "upload:"] )