From 07348570ff00b3e53dae8876bc9ad6f98ddf4f90 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 7 Apr 2019 23:43:17 +0100 Subject: [PATCH] build/lftp: Use commands file --- build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build b/build index f92bb6e..49ed097 100755 --- a/build +++ b/build @@ -319,6 +319,8 @@ task_deploy() { # 3. Create data dir symlink # 4. Swap in new directory # 5. Delete old directory + lftp_commands_filename="$(mktemp --suffix "-commands.lftp")"; + ( echo "set sftp:connect-program 'ssh -x -i \"${SSH_KEY_PATH}\" -p \"${deploy_ssh_port}\" -o \"PasswordAuthentication=no\"'"; # We have an extra : before the @ here to avoid the password prompt @@ -331,7 +333,10 @@ task_deploy() { echo "mv \"${deploy_root_dir}/www-new\" \"${deploy_root_dir}/www\""; echo "rm -r \"${deploy_root_dir}/www-old\""; echo "bye"; - ) | tee | lftp + ) >"${lftp_commands_filename}"; + + execute lftp --version; + execute lftp -f "${lftp_commands_filename}"; exec 9>&- # Close file descriptor 9 and release the lock