You must provide the Drone server address

Hi all

I have created the following pipeline:

---
kind: pipeline
type: docker
name: Play with ssh

steps:
  - name: Promote to STAGE
    image: appleboy/drone-ssh
    settings:
      host: ci.example.io
      username: secret
      password: secret
      port: 22
      script:
        - echo "Welcome SSH"
        - ls -la
        - drone info

trigger:
  branch:
    - master

When the pipeline runs, it shows:

======CMD======
echo "Welcome SSH"
ls -la
drone info
======END======
out: Welcome SSH
out: total 100
out: drwxr-xr-x 15 admin admin  4096 May 21 09:37 .
out: drwxr-xr-x  3 root  root   4096 Apr 10 20:21 ..
out: -rw-------  1 admin admin 19418 Oct  7 09:33 .bash_history
out: -rw-r--r--  1 admin admin   220 Apr 18  2019 .bash_logout
out: -rw-r--r--  1 admin admin  3727 Apr 10 20:39 .bashrc
out: drwxr-xr-x  3 admin admin  4096 Apr 23 20:00 .cache
out: -rw-r--r--  1 admin admin     0 Apr 10 20:17 .cloud-locale-test.skip
out: drwx------  3 admin admin  4096 Apr 16 20:51 .config
out: drwx------  2 admin admin  4096 May 21 14:22 .docker
out: drwxr-xr-x  2 admin admin  4096 May  5 16:21 downloads
out: drwxr-xr-x  2 admin admin  4096 Oct  4 19:46 drone
out: drwx------  3 admin admin  4096 Apr 10 20:26 .gnupg
out: drwxr-xr-x  3 admin admin  4096 Apr 23 20:01 go
out: drwx------  3 admin admin  4096 Apr 10 20:28 .local
out: drwxr-xr-x  4 admin admin  4096 Apr 10 20:43 .m2
out: -rw-r--r--  1 admin admin   976 Apr 30 20:25 .profile
out: drwxr-xr-x  4 admin admin  4096 Apr 13 20:54 proxy
out: drwxr-xr-x 10 admin admin  4096 Apr 10 20:39 .sdkman
out: drwx------  2 admin admin  4096 Apr 28 08:53 .ssh
out: drwxr-xr-x  2 admin admin  4096 May  3 13:54 wordpress
out: -rw-r--r--  1 admin admin   201 Apr 10 20:39 .zshrc
err: Error: you must provide the Drone server address.
2020/10/07 11:07:09 Process exited with status 1

Logging into the server and type drone info in the terminal, it show the expected information.
What am I doing wrong with the SSH-Plugin?

Thanks

I tried the following:

---
kind: pipeline
type: docker
name: Play with ssh

steps:
  - name: Promote to STAGE
    image: appleboy/drone-ssh
    settings:
      host: ci.example.io
      username: secret
      password: secret
      port: 22
      script:
        - export DRONE_SERVER=https://ci.example.io
        - export DRONE_TOKEN=secret
        - echo "Welcome SSH"
        - ls -la
        - drone info

trigger:
  branch:
    - master

and it works. I think, maybe do I have to provide DRONE_SERVER and DRONE_TOKEN in a file?

If you are want to execute the drone info command you must provide the server address and token [1]. Your first example fails because this information was not provided. The second example succeeds because this information was provided. The system seems to be working as expected, although perhaps I am missing something …

[1] https://docs.drone.io/cli/configure/

Do I have to provide the export in the pipeline or where do I have to provide it?

I have provided on the server, where Drone runs:

drone info
User: usertest
Email: test@example.io

So I have provide it in the pipeline right?

you would provide as you have done in your previous post:

      script:
        - export DRONE_SERVER=https://ci.example.io
        - export DRONE_TOKEN=secret
        - echo "Welcome SSH"
        - ls -la
        - drone info
1 Like