build/lftp: Use commands file

This commit is contained in:
Starbeamrainbowlabs 2019-04-07 23:43:17 +01:00
parent d74ba662fa
commit 07348570ff
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

7
build
View file

@ -319,6 +319,8 @@ task_deploy() {
# 3. Create data dir symlink # 3. Create data dir symlink
# 4. Swap in new directory # 4. Swap in new directory
# 5. Delete old 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\"'"; 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 # 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 "mv \"${deploy_root_dir}/www-new\" \"${deploy_root_dir}/www\"";
echo "rm -r \"${deploy_root_dir}/www-old\""; echo "rm -r \"${deploy_root_dir}/www-old\"";
echo "bye"; 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 exec 9>&- # Close file descriptor 9 and release the lock