appleboy / drone-scp

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

Support multiple hosts with different passwords ? #120

Closed medivh-jay closed 1 year ago

medivh-jay commented 3 years ago

Hello , Thanks for your scp tool , It saved me a lot of work!

judging from the plug-in documentation, this plugin support multiple hosts, but it seems that all hosts must have the same SSH password, can it support each host to use a different password?

Thanks!

imkratos commented 2 years ago

UP , I need same features, Thanks.

Wolf2789 commented 2 years ago

Why not just add duplicate steps for hosts with different passwords? Templating could be helpful there:

steps:
...
- name: Settings template
  image: appleboy/drone-scp
  settings: &scp_settings
    source: ./
    target: /tmp/target
  when:
    event:
      - template # Making sure here, the step never executes

- name: Deploy 1
  image: appleboy/drone-scp
  settings:
    <<: *scp_settings
    host:
      - 127.0.0.1
    user: admin
    password:
      from_secret: PASSWORD_1

- name: Deploy 2
  image: appleboy/drone-scp
  settings:
    <<: *scp_settings
    host:
      - 127.0.0.2
    user: admin
    password:
      from_secret: PASSWORD_2
appleboy commented 1 year ago

as @Wolf2789 mention. Please try it out.