Skip to content

Commit 017b95b

Browse files
committed
Implement custom rsync options
Fixes #2
1 parent 22fbf3d commit 017b95b

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

sync/config.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ type Filesystem struct {
4141
Filter Filter `yaml:"filter"`
4242
// Connection for filesystem sync (optional, default is Server connection)
4343
Connection *YamlCommandBuilderConnection `yaml:"connection"`
44-
Options struct {
45-
// Generate stubs (small example files) instead of fetching files from remote
46-
GenerateStubs bool `yaml:"generate-stubs"`
47-
} `yaml:"options"`
44+
Options FilesystemOptions `yaml:"options"`
4845
}
4946

5047
type Database struct {
@@ -134,6 +131,13 @@ type DatabaseOptions struct {
134131
Psql *YamlStringArray `yaml:"psql"`
135132
}
136133

134+
type FilesystemOptions struct {
135+
// Generate stubs (small example files) instead of fetching files from remote
136+
GenerateStubs bool `yaml:"generate-stubs"`
137+
// Arguments for psql command
138+
Rsync *YamlStringArray `yaml:"rsync"`
139+
}
140+
137141
type EnvironmentVar struct {
138142
// Name of variable
139143
Name string `yaml:"name"`

sync/server_deploy_filesystem.go

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ func (filesystem *Filesystem) deployRsync() {
2727

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

30+
// add custom options
31+
if filesystem.Options.Rsync != nil {
32+
args = append(args, filesystem.Options.Rsync.Array()...)
33+
}
34+
3035
if filesystem.Connection.GetInstance().IsSsh() {
3136
args = append(args, "-e", shell.Quote("ssh " + strings.Join(commandbuilder.ConnectionSshArguments, " ")))
3237
}

sync/server_sync_filesystem.go

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ func (filesystem *Filesystem) syncRsync() {
2727

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

30+
// add custom options
31+
if filesystem.Options.Rsync != nil {
32+
args = append(args, filesystem.Options.Rsync.Array()...)
33+
}
34+
3035
if filesystem.Connection.GetInstance().IsSsh() {
3136
args = append(args, "-e", shell.Quote("ssh " + strings.Join(commandbuilder.ConnectionSshArguments, " ")))
3237
}

0 commit comments

Comments
 (0)