mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-05-09 18:23:21 +08:00
update docs (#94)
* update docs Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * [ci skip] add username secret. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
538a5a6ce5
commit
bf269615ce
89
DOCS.md
89
DOCS.md
@ -40,38 +40,6 @@ pipeline:
|
|||||||
- echo world
|
- echo world
|
||||||
```
|
```
|
||||||
|
|
||||||
Example configuration for login with user private key:
|
|
||||||
|
|
||||||
```diff
|
|
||||||
pipeline:
|
|
||||||
ssh:
|
|
||||||
image: appleboy/drone-ssh
|
|
||||||
host: foo.com
|
|
||||||
username: root
|
|
||||||
- password: 1234
|
|
||||||
+ key: ${DEPLOY_KEY}
|
|
||||||
port: 22
|
|
||||||
script:
|
|
||||||
- echo hello
|
|
||||||
- echo world
|
|
||||||
```
|
|
||||||
|
|
||||||
Example configuration for login with file path of user private key:
|
|
||||||
|
|
||||||
```diff
|
|
||||||
pipeline:
|
|
||||||
ssh:
|
|
||||||
image: appleboy/drone-ssh
|
|
||||||
host: foo.com
|
|
||||||
username: root
|
|
||||||
- password: 1234
|
|
||||||
+ key_path: ./deploy/key.pem
|
|
||||||
port: 22
|
|
||||||
script:
|
|
||||||
- echo hello
|
|
||||||
- echo world
|
|
||||||
```
|
|
||||||
|
|
||||||
Example configuration for command timeout (unit: second), default value is 60 seconds:
|
Example configuration for command timeout (unit: second), default value is 60 seconds:
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
@ -96,15 +64,15 @@ pipeline:
|
|||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
host: foo.com
|
host: foo.com
|
||||||
username: root
|
username: root
|
||||||
|
password: 1234
|
||||||
port: 22
|
port: 22
|
||||||
key: ${DEPLOY_KEY}
|
|
||||||
script:
|
script:
|
||||||
- echo hello
|
- echo hello
|
||||||
- echo world
|
- echo world
|
||||||
+ proxy_host: 10.130.33.145
|
+ proxy_host: 10.130.33.145
|
||||||
+ proxy_user: ubuntu
|
+ proxy_user: ubuntu
|
||||||
+ proxy_port: 22
|
+ proxy_port: 22
|
||||||
+ proxy_key: ${PROXY_KEY}
|
+ proxy_password: 1234
|
||||||
```
|
```
|
||||||
|
|
||||||
Example configuration for success build:
|
Example configuration for success build:
|
||||||
@ -142,7 +110,38 @@ pipeline:
|
|||||||
+ event: tag
|
+ event: tag
|
||||||
```
|
```
|
||||||
|
|
||||||
Example configuration for using custom secrets:
|
Example configuration using password from secrets:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
pipeline:
|
||||||
|
ssh:
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
host: foo.com
|
||||||
|
username: root
|
||||||
|
- password: 1234
|
||||||
|
port: 22
|
||||||
|
+ secrets: [ ssh_password ]
|
||||||
|
script:
|
||||||
|
- echo hello
|
||||||
|
- echo world
|
||||||
|
```
|
||||||
|
|
||||||
|
Example configuration using ssh key from secrets:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
pipeline:
|
||||||
|
ssh:
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
host: foo.com
|
||||||
|
username: root
|
||||||
|
port: 22
|
||||||
|
+ secrets: [ ssh_key ]
|
||||||
|
script:
|
||||||
|
- echo hello
|
||||||
|
- echo world
|
||||||
|
```
|
||||||
|
|
||||||
|
Example configuration for exporting custom secrets:
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
pipeline:
|
pipeline:
|
||||||
@ -158,7 +157,25 @@ pipeline:
|
|||||||
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
|
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
|
||||||
```
|
```
|
||||||
|
|
||||||
This allows us to use custom secrets (The one's that the plugin doesn't expect) which can be used in the script section.
|
# Secret Reference
|
||||||
|
|
||||||
|
ssh_username
|
||||||
|
: account for target host user
|
||||||
|
|
||||||
|
ssh_password
|
||||||
|
: password for target host user
|
||||||
|
|
||||||
|
ssh_key
|
||||||
|
: plain text of user private key
|
||||||
|
|
||||||
|
proxy_ssh_username
|
||||||
|
: account for user of proxy server
|
||||||
|
|
||||||
|
proxy_ssh_password
|
||||||
|
: password for user of proxy server
|
||||||
|
|
||||||
|
proxy_ssh_key
|
||||||
|
: plain text of user private key for proxy server
|
||||||
|
|
||||||
# Parameter Reference
|
# Parameter Reference
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user