appleboy / drone-ssh

Drone plugin for executing remote ssh commands
MIT License
251 stars 74 forks source link

CANNOT execute commands in Windows host #233

Open maotou316 opened 1 year ago

maotou316 commented 1 year ago

Hi everyone,

I'm having an issue with a Drone CI pipeline step. I'm trying to run some commands on a remote Windows server using the appleboy/drone-ssh image, but I'm encountering an issue where some commands are not executing.

Here's an example step that's failing:


- name: '部署到Web'
  image: appleboy/drone-ssh
  settings:
    host: 192.168.50.249
    port: 22
    username: administrator
    password:
      from_secret: pws_web
    script:
      - echo "Web Master"
      - ls

When I run this step, the echo command works correctly and outputs "Web Master" to the console, but the ls command does not seem to have any effect.

I've tried different commands, such as dir, but they all exhibit the same behavior. I know that the SSH connection is working because I'm able to run echo without any issues.

Can someone please point me in the right direction on how to troubleshoot this issue? I'm not sure if this is an issue with the SSH connection or with the command that I'm running.

Thank you in advance for any help you can provide.

Best regards,

Inzilbeth commented 7 months ago

Multiple commands don't seem to be working for windows, I use the following as a workaround:

script:
  - command1 && command2 && ...