appleboy / drone-scp

Copy files and artifacts via SSH using a binary, docker or Drone CI.
MIT License
142 stars 30 forks source link

do not include source path in target destination #64

Closed bradrydzewski closed 7 years ago

bradrydzewski commented 7 years ago

I have the following configuration

    target: /usr/local/bin/
    source: release/some-binary

It copies release/some-binary to /usr/local/bin/release/some-binary

If I were using scp, I would expect that it copies release/some-binary to /usr/local/bin/some-binary and does include the source path in the target destination.

appleboy commented 7 years ago

I will take it.

appleboy commented 7 years ago

@bradrydzewski Try the following config:

+   strip_components: 1
    target: /usr/local/bin/
    source: release/some-binary

Remove the specified number of leading path elements.

b12f commented 6 years ago

It would be great if this were mentioned in the docs, I just spent an hour or two searching for this before going through the issues by hand.

appleboy commented 6 years ago

@b12f See https://github.com/drone/drone-plugin-index/pull/81 and the latest document here

b12f commented 6 years ago

@appleboy looks great! Also, thanks for writing the plugin.

WindGreen commented 6 years ago

I have config:

target:
  - /root/project
source:
  - run.sh
  - config/dev/conf

I want:

/root/project/run.sh
/root/project/conf

When I use strip_components=2, the "run.sh" file is missed

So I suggest to use a bool param to decide whether tar parent directory when tar files


When I have config:

    target:
      - /home/deploy/web1
      - /home/deploy/web2
    source:
      - release_1.tar.gz
      - release_2.tar.gz

Should I supposed copy release_1.tar.gz to web1 and release_2.tar.gz to web2 ? But result is both release_1.tar.gz and release_2.tar.gz are in web1 and web2