Proxy scp for piku user, add 'download' local cmd.

pull/341/head
Chris McCormick 2024-04-11 18:53:29 +01:00
rodzic c5a105f676
commit 5c33e28b94
2 zmienionych plików z 12 dodań i 0 usunięć

5
piku
Wyświetl plik

@ -52,6 +52,8 @@ else
ssh -o LogLevel=QUIET ${sshflags} "$server" "$@" | grep -v "INTERNAL"
echo " shell Local command to start an SSH session in the remote."
echo " init Local command to download an example ENV and Procfile."
echo " download Local command to scp down a remote file. args: REMOTE-FILE(s) LOCAL-PATH"
echo " Remote file path is relative to the app folder."
;;
apps|setup|setup:ssh|update)
ssh ${sshflags} "$server" "$@"
@ -59,6 +61,9 @@ else
shell)
ssh -t "$server" run "$app" bash
;;
download)
scp "$server:~/.piku/apps/${app}/${2}" ${3:-'.'}
;;
*)
shift # remove cmd arg
ssh ${sshflags} "$server" "$cmd" "$app" "$@"

Wyświetl plik

@ -1649,6 +1649,13 @@ def cmd_git_upload_pack(app):
call('git-shell -c "{}" '.format(argv[1] + " '{}'".format(app)), cwd=GIT_ROOT, shell=True)
@piku.command("scp", context_settings=dict(ignore_unknown_options=True, allow_extra_args=True))
@pass_context
def cmd_scp(ctx):
"""Simple wrapper to allow scp to work."""
call(" ".join(["scp"] + ctx.args), cwd=GIT_ROOT, shell=True)
def _get_plugin_commands(path):
sys_path.append(abspath(path))