Migrated plugin to 0.5 structure

This commit is contained in:
Thomas Boerger
2016-07-11 19:47:15 +02:00
committed by Thomas Boerger
parent 69b686b375
commit c816c75fc6
12 changed files with 254 additions and 307 deletions
+49 -15
View File
@@ -1,14 +1,48 @@
Use the SSH plugin to execute commands on a remote server. The following parameters are used to configure this plugin:
Use the SSH plugin to execute commands on a remote server. You will need to
supply Drone with a private SSH key to being able to connect to a host.
* `host` - address or IP of the remote machine
* `port` - port to connect to on the remote machine
* `user` - user to log in as on the remote machine
* `commands` - list of commands to execute
## Overview
Example configuration in your .drone.yml file:
The following parameters are used to configure the plugin:
* **host** - address or IP of the remote machine
* **port** - port to connect to on the remote machine
* **user** - user to log in as on the remote machine
* **key** - private SSH key for the remote machine
* **sleep** - sleep for seconds between host connections
* **commands** - list of commands to execute
The following secret values can be set to configure the plugin.
* **SSH_HOST** - corresponds to **host**
* **SSH_PORT** - corresponds to **port**
* **SSH_USER** - corresponds to **user**
* **SSH_KEY** - corresponds to **key**
* **SSH_SLEEP** - corresponds to **sleep**
It is highly recommended to put the **SSH_KEY** into a secret so it is not
exposed to users. This can be done using the drone-cli.
```bash
drone secret add --image=ssh \
octocat/hello-world SSH_KEY @${HOME}/.ssh/id_rsa
```
Then sign the YAML file after all secrets are added.
```bash
drone sign octocat/hello-world
```
See [secrets](http://readme.drone.io/0.5/usage/secrets/) for additional
information on secrets
## Examples
Example configuration in your .drone.yml file for a single host:
```yaml
deploy:
pipeline:
ssh:
host: foo.com
user: root
@@ -18,10 +52,10 @@ deploy:
- echo world
```
Example multi-host configuration in your .drone.yml file:
Example configuration in your .drone.yml file for multiple hosts:
```yaml
deploy:
pipeline:
ssh:
host:
- foo.com
@@ -34,10 +68,10 @@ deploy:
- 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.
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.
The above example also uses the `sleep` parameter. The sleep parameter instructs Drone to sleep for N seconds between host executions.
## 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.
The above example also uses the `sleep` parameter. The sleep parameter
instructs Drone to sleep for N seconds between host executions.