mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-05-09 18:23:21 +08:00
1.2 KiB
1.2 KiB
Use the SSH plugin to execute commands on a remote server. The following parameters are used to configure this plugin:
host
- address or IP of the remote machineport
- port to connect to on the remote machineuser
- user to log in as on the remote machinecommands
- list of commands to execute
Example configuration in your .drone.yml file:
deploy:
ssh:
host: foo.com
user: root
port: 22
commands:
- echo hello
- echo world
Example multi-host configuration in your .drone.yml file:
deploy:
ssh:
host:
- foo.com
- bar.com
user: root
port: 22
commands:
- echo hello
- echo world
In the above example Drone executes the commands on multiple hosts sequentially. If the commands fail on a single host this plugin exits immediatly, and will not run your commands on the remaining hosts in the list.
Keys
The plugin authenticates to your server using a per-repository SSH key generated by Drone. You can find the public key in your repository settings in Drone. You will need to copy / paste this key into your ~/.ssh/authorized_keys
file on your remote machine.