mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-05-09 18:23:21 +08:00
docs: update to drone 1.0
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
56b67e1314
commit
e7fd9e9b89
126
DOCS.md
126
DOCS.md
@ -14,13 +14,14 @@ Use the SSH plugin to execute commands on a remote server. The below pipeline co
|
|||||||
pipeline:
|
pipeline:
|
||||||
ssh:
|
ssh:
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
host: foo.com
|
settings:
|
||||||
username: root
|
host: foo.com
|
||||||
password: 1234
|
username: root
|
||||||
port: 22
|
password: 1234
|
||||||
script:
|
port: 22
|
||||||
- echo hello
|
script:
|
||||||
- echo world
|
- echo hello
|
||||||
|
- echo world
|
||||||
```
|
```
|
||||||
|
|
||||||
Example configuration in your `.drone.yml` file for multiple hosts:
|
Example configuration in your `.drone.yml` file for multiple hosts:
|
||||||
@ -29,31 +30,33 @@ Example configuration in your `.drone.yml` file for multiple hosts:
|
|||||||
pipeline:
|
pipeline:
|
||||||
ssh:
|
ssh:
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
host:
|
settings:
|
||||||
+ - foo.com
|
host:
|
||||||
+ - bar.com
|
+ - foo.com
|
||||||
username: root
|
+ - bar.com
|
||||||
password: 1234
|
username: root
|
||||||
port: 22
|
password: 1234
|
||||||
script:
|
port: 22
|
||||||
- echo hello
|
script:
|
||||||
- echo world
|
- echo hello
|
||||||
|
- echo world
|
||||||
```
|
```
|
||||||
|
|
||||||
Example configuration for command timeout (unit: second), default value is 60 seconds:
|
Example configuration for command timeout, default value is 60 seconds:
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
pipeline:
|
pipeline:
|
||||||
ssh:
|
ssh:
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
host: foo.com
|
settings:
|
||||||
username: root
|
host: foo.com
|
||||||
password: 1234
|
username: root
|
||||||
port: 22
|
password: 1234
|
||||||
+ command_timeout: 120
|
port: 22
|
||||||
script:
|
+ command_timeout: 2m
|
||||||
- echo hello
|
script:
|
||||||
- echo world
|
- echo hello
|
||||||
|
- echo world
|
||||||
```
|
```
|
||||||
|
|
||||||
Example configuration for execute commands on a remote server using `SSHProxyCommand`:
|
Example configuration for execute commands on a remote server using `SSHProxyCommand`:
|
||||||
@ -62,17 +65,18 @@ Example configuration for execute commands on a remote server using `SSHProxyC
|
|||||||
pipeline:
|
pipeline:
|
||||||
ssh:
|
ssh:
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
host: foo.com
|
settings:
|
||||||
username: root
|
host: foo.com
|
||||||
password: 1234
|
username: root
|
||||||
port: 22
|
password: 1234
|
||||||
script:
|
port: 22
|
||||||
- echo hello
|
script:
|
||||||
- echo world
|
- echo hello
|
||||||
+ proxy_host: 10.130.33.145
|
- echo world
|
||||||
+ proxy_user: ubuntu
|
+ proxy_host: 10.130.33.145
|
||||||
+ proxy_port: 22
|
+ proxy_user: ubuntu
|
||||||
+ proxy_password: 1234
|
+ proxy_port: 22
|
||||||
|
+ proxy_password: 1234
|
||||||
```
|
```
|
||||||
|
|
||||||
Example configuration using password from secrets:
|
Example configuration using password from secrets:
|
||||||
@ -81,14 +85,15 @@ Example configuration using password from secrets:
|
|||||||
pipeline:
|
pipeline:
|
||||||
ssh:
|
ssh:
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
host: foo.com
|
settings:
|
||||||
username: root
|
host: foo.com
|
||||||
- password: 1234
|
username: root
|
||||||
port: 22
|
+ password:
|
||||||
+ secrets: [ ssh_password ]
|
+ from_secret: ssh_password
|
||||||
script:
|
port: 22
|
||||||
- echo hello
|
script:
|
||||||
- echo world
|
- echo hello
|
||||||
|
- echo world
|
||||||
```
|
```
|
||||||
|
|
||||||
Example configuration using ssh key from secrets:
|
Example configuration using ssh key from secrets:
|
||||||
@ -97,13 +102,15 @@ Example configuration using ssh key from secrets:
|
|||||||
pipeline:
|
pipeline:
|
||||||
ssh:
|
ssh:
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
host: foo.com
|
settings:
|
||||||
username: root
|
host: foo.com
|
||||||
port: 22
|
username: root
|
||||||
+ secrets: [ ssh_key ]
|
port: 22
|
||||||
script:
|
+ key:
|
||||||
- echo hello
|
+ from_secret: ssh_key
|
||||||
- echo world
|
script:
|
||||||
|
- echo hello
|
||||||
|
- echo world
|
||||||
```
|
```
|
||||||
|
|
||||||
Example configuration for exporting custom secrets:
|
Example configuration for exporting custom secrets:
|
||||||
@ -112,14 +119,15 @@ Example configuration for exporting custom secrets:
|
|||||||
pipeline:
|
pipeline:
|
||||||
ssh:
|
ssh:
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
host: foo.com
|
settings:
|
||||||
username: root
|
host: foo.com
|
||||||
password: 1234
|
username: root
|
||||||
port: 22
|
password: 1234
|
||||||
+ secrets: [ aws_access_key_id ]
|
port: 22
|
||||||
+ envs: [ aws_access_key_id ]
|
+ envs:
|
||||||
script:
|
- aws_access_key_id
|
||||||
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
|
script:
|
||||||
|
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
|
||||||
```
|
```
|
||||||
|
|
||||||
# Secret Reference
|
# Secret Reference
|
||||||
|
Loading…
Reference in New Issue
Block a user