Skip to content

Commit 18b08f2

Browse files
committed
Add default ssh args for rsync
1 parent 334c583 commit 18b08f2

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

sync/server_deploy_filesystem.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package sync
22

33
import (
4+
"os"
45
"fmt"
56
"errors"
6-
"os"
7+
"strings"
78
"github.com/webdevops/go-shell"
9+
"github.com/webdevops/go-shell/commandbuilder"
810
)
911

1012
// General sync
@@ -25,6 +27,10 @@ func (filesystem *Filesystem) deployRsync() {
2527

2628
args := []string{"-rlptD", "--delete-after", "--progress", "--human-readable"}
2729

30+
if filesystem.Connection.GetInstance().IsSsh() {
31+
args = append(args, "-e", shell.Quote("ssh " + strings.Join(commandbuilder.ConnectionSshArguments, " ")))
32+
}
33+
2834
// include filter
2935
if len(filesystem.Filter.Include) > 0 {
3036
includeTempFile := CreateTempfileWithContent(filesystem.Filter.Include...)

sync/server_sync_filesystem.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package sync
22

33
import (
4+
"os"
45
"fmt"
56
"errors"
6-
"os"
7+
"strings"
78
"github.com/webdevops/go-shell"
9+
"github.com/webdevops/go-shell/commandbuilder"
810
)
911

1012
// General sync
@@ -25,6 +27,10 @@ func (filesystem *Filesystem) syncRsync() {
2527

2628
args := []string{"-rlptD", "--delete-after", "--progress", "--human-readable"}
2729

30+
if filesystem.Connection.GetInstance().IsSsh() {
31+
args = append(args, "-e", shell.Quote("ssh " + strings.Join(commandbuilder.ConnectionSshArguments, " ")))
32+
}
33+
2834
// include filter
2935
if len(filesystem.Filter.Include) > 0 {
3036
includeTempFile := CreateTempfileWithContent(filesystem.Filter.Include...)

0 commit comments

Comments
 (0)