mirror of
https://cgit.krebsco.de/krops
synced 2024-11-23 03:29:48 +01:00
krops remoteCommand: don't ssh if target is local
This commit is contained in:
parent
476fb97dc9
commit
67132ed53f
1 changed files with 12 additions and 9 deletions
|
@ -18,15 +18,18 @@ in
|
||||||
}";
|
}";
|
||||||
|
|
||||||
remoteCommand = target: command:
|
remoteCommand = target: command:
|
||||||
writers.writeDash "build.${target.host}" ''
|
if lib.isLocalTarget target
|
||||||
exec ${openssh}/bin/ssh ${lib.escapeShellArgs (lib.flatten [
|
then command
|
||||||
(lib.optionals (target.user != "") ["-l" target.user])
|
else
|
||||||
"-p" target.port
|
writers.writeDash "build.${target.host}" ''
|
||||||
"-t"
|
exec ${openssh}/bin/ssh ${lib.escapeShellArgs (lib.flatten [
|
||||||
target.extraOptions
|
(lib.optionals (target.user != "") ["-l" target.user])
|
||||||
target.host
|
"-p" target.port
|
||||||
(if target.sudo then "sudo ${command}" else command)])}
|
"-t"
|
||||||
'';
|
target.extraOptions
|
||||||
|
target.host
|
||||||
|
(if target.sudo then "sudo ${command}" else command)])}
|
||||||
|
'';
|
||||||
|
|
||||||
writeCommand = name: {
|
writeCommand = name: {
|
||||||
command ? (targetPath: "echo ${targetPath}"),
|
command ? (targetPath: "echo ${targetPath}"),
|
||||||
|
|
Loading…
Reference in a new issue