From 87c762f222279dbf0339318dfb42a158fa2bcaff Mon Sep 17 00:00:00 2001 From: Nurahmadie Date: Wed, 7 May 2014 03:25:42 +0700 Subject: [PATCH] Add -r flag to enable recursive scp --- pkg/plugin/deploy/ssh.go | 2 +- pkg/plugin/deploy/ssh_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/plugin/deploy/ssh.go b/pkg/plugin/deploy/ssh.go index 59ab7d6d6..216e1fab5 100644 --- a/pkg/plugin/deploy/ssh.go +++ b/pkg/plugin/deploy/ssh.go @@ -73,7 +73,7 @@ func (s *SSH) Write(f *buildfile.Buildfile) { } if artifact { - scpCmd := "scp -o StrictHostKeyChecking=no -P %s ${ARTIFACT} %s" + scpCmd := "scp -o StrictHostKeyChecking=no -P %s -r ${ARTIFACT} %s" f.WriteCmd(fmt.Sprintf(scpCmd, host[1], host[0])) } diff --git a/pkg/plugin/deploy/ssh_test.go b/pkg/plugin/deploy/ssh_test.go index 53e25a29b..c2b82d492 100644 --- a/pkg/plugin/deploy/ssh_test.go +++ b/pkg/plugin/deploy/ssh_test.go @@ -85,7 +85,7 @@ func TestSSHOneArtifact(t *testing.T) { t.Errorf("Expect script to contains artifact") } - if !strings.Contains(bscr, "scp -o StrictHostKeyChecking=no -P 2212 ${ARTIFACT} user@test.example.com:/srv/app/location") { + if !strings.Contains(bscr, "scp -o StrictHostKeyChecking=no -P 2212 -r ${ARTIFACT} user@test.example.com:/srv/app/location") { t.Errorf("Expect script to contains scp command, got:\n%s", bscr) } }