Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
7eaf76671a | |||
176437b548 | |||
25259c3d50 | |||
bf84378588 | |||
362a7f1677 | |||
ab698e59d8 | |||
703ffa3c1e | |||
8b84eaec3a | |||
2763143a97 | |||
3f1416813d | |||
bb32884d53 |
14
.github/workflows/main.yml
vendored
14
.github/workflows/main.yml
vendored
@ -37,7 +37,19 @@ jobs:
|
||||
username: linuxserver.io
|
||||
password: password
|
||||
port: 2222
|
||||
script: whoami
|
||||
script: |
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
whoami
|
||||
|
||||
- name: ssh commands from a file
|
||||
uses: ./
|
||||
with:
|
||||
host: ${{ env.REMOTE_HOST }}
|
||||
username: linuxserver.io
|
||||
password: password
|
||||
port: 2222
|
||||
script_path: testdata/test.sh
|
||||
|
||||
check-ssh-key:
|
||||
runs-on: ubuntu-latest
|
||||
|
5
.github/workflows/stable.yml
vendored
5
.github/workflows/stable.yml
vendored
@ -37,7 +37,10 @@ jobs:
|
||||
username: linuxserver.io
|
||||
password: password
|
||||
port: 2222
|
||||
script: whoami
|
||||
script: |
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
whoami
|
||||
|
||||
check-ssh-key:
|
||||
runs-on: ubuntu-latest
|
||||
|
51
README.md
51
README.md
@ -18,7 +18,7 @@ This thing is built using [Golang](https://go.dev) and [drone-ssh](https://githu
|
||||
See [action.yml](./action.yml) for more detailed information.
|
||||
|
||||
| Input Parameter | Description | Default Value |
|
||||
|---------------------------|------------------------------------------------------------------------------------------|---------------|
|
||||
| ------------------------- | ---------------------------------------------------------------------------------------- | ------------- |
|
||||
| host | SSH host address | |
|
||||
| port | SSH port number | 22 |
|
||||
| passphrase | SSH key passphrase | |
|
||||
@ -35,6 +35,7 @@ See [action.yml](./action.yml) for more detailed information.
|
||||
| fingerprint | SHA256 fingerprint of the host public key | |
|
||||
| proxy_host | SSH proxy host | |
|
||||
| proxy_port | SSH proxy port | 22 |
|
||||
| proxy_protocol | SSH proxy protocol version (tcp, tcp4, tcp6) | tcp |
|
||||
| proxy_username | SSH proxy username | |
|
||||
| proxy_password | SSH proxy password | |
|
||||
| proxy_passphrase | SSH proxy key passphrase | |
|
||||
@ -45,6 +46,7 @@ See [action.yml](./action.yml) for more detailed information.
|
||||
| proxy_cipher | Allowed cipher algorithms for the proxy | |
|
||||
| proxy_use_insecure_cipher | Include more ciphers with use_insecure_cipher for the proxy | false |
|
||||
| script | Execute commands | |
|
||||
| script_file | Execute commands from a file | |
|
||||
| script_stop | Stop script after first failure | false |
|
||||
| envs | Pass environment variables to shell script | |
|
||||
| envs_format | Flexible configuration of environment value transfer | |
|
||||
@ -66,10 +68,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: executing remote ssh commands using password
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
username: linuxserver.io
|
||||
password: ${{ secrets.PASSWORD }}
|
||||
port: ${{ secrets.PORT }}
|
||||
script: whoami
|
||||
@ -81,10 +83,10 @@ output:
|
||||
======CMD======
|
||||
whoami
|
||||
======END======
|
||||
out: ***
|
||||
==============================================
|
||||
✅ Successfully executed commands to all host.
|
||||
==============================================
|
||||
linuxserver.io
|
||||
===============================================
|
||||
✅ Successfully executed commands to all hosts.
|
||||
===============================================
|
||||
```
|
||||
|
||||
### Setting up a SSH Key
|
||||
@ -182,7 +184,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||
```yaml
|
||||
- name: executing remote ssh commands using password
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -195,7 +197,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||
```yaml
|
||||
- name: executing remote ssh commands using ssh key
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -208,7 +210,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||
```yaml
|
||||
- name: multiple command
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -221,11 +223,24 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||

|
||||
|
||||
#### Commands from a file
|
||||
|
||||
```yaml
|
||||
- name: file commands
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
script_path: scripts/script.sh
|
||||
```
|
||||
|
||||
#### Multiple Hosts
|
||||
|
||||
```diff
|
||||
- name: multiple host
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
- host: "foo.com"
|
||||
+ host: "foo.com,bar.com"
|
||||
@ -243,7 +258,7 @@ The default value of `port` is `22`.
|
||||
|
||||
```diff
|
||||
- name: multiple host
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
- host: "foo.com"
|
||||
+ host: "foo.com:1234,bar.com:5678"
|
||||
@ -258,7 +273,7 @@ The default value of `port` is `22`.
|
||||
|
||||
```diff
|
||||
- name: multiple host
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: "foo.com,bar.com"
|
||||
+ sync: true
|
||||
@ -274,7 +289,7 @@ The default value of `port` is `22`.
|
||||
|
||||
```diff
|
||||
- name: pass environment
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
+ env:
|
||||
+ FOO: "BAR"
|
||||
+ BAR: "FOO"
|
||||
@ -299,7 +314,7 @@ _Inside `env` object, you need to pass every environment variable as a string, p
|
||||
|
||||
```diff
|
||||
- name: stop script if command error
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -352,7 +367,7 @@ Host FooServer
|
||||
|
||||
```diff
|
||||
- name: ssh proxy command
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -375,7 +390,7 @@ It is not uncommon for files to leak from backups or decommissioned hardware, an
|
||||
|
||||
```diff
|
||||
- name: ssh key passphrase
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -401,7 +416,7 @@ Now you can adjust you config:
|
||||
|
||||
```diff
|
||||
- name: ssh key passphrase
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
|
@ -24,6 +24,7 @@
|
||||
* `key_path` - SSH 私钥的路径
|
||||
* `fingerprint` - 主机公钥的 SHA256 指纹,默认为跳过验证
|
||||
* `script` - 执行命令
|
||||
* `script_file` - 執行命令的文件
|
||||
* `script_stop` - 当出现第一个错误时停止执行命令
|
||||
* `envs` - 传递环境变量到 shell script
|
||||
* `debug` - 启用调试模式
|
||||
@ -58,7 +59,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: executing remote ssh commands using password
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -74,9 +75,9 @@ jobs:
|
||||
whoami
|
||||
======END======
|
||||
out: ***
|
||||
==============================================
|
||||
✅ Successfully executed commands to all host.
|
||||
==============================================
|
||||
===============================================
|
||||
✅ Successfully executed commands to all hosts.
|
||||
===============================================
|
||||
```
|
||||
|
||||
### 设置 SSH 密钥
|
||||
@ -157,7 +158,7 @@ ssh-keygen -t ed25519 -a 200 -C ”your_email@example.com“
|
||||
|
||||
```yaml
|
||||
- name: executing remote ssh commands using password
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -170,7 +171,7 @@ ssh-keygen -t ed25519 -a 200 -C ”your_email@example.com“
|
||||
|
||||
```yaml
|
||||
- name: executing remote ssh commands using ssh key
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -183,7 +184,7 @@ ssh-keygen -t ed25519 -a 200 -C ”your_email@example.com“
|
||||
|
||||
```yaml
|
||||
- name: multiple command
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -200,7 +201,7 @@ ssh-keygen -t ed25519 -a 200 -C ”your_email@example.com“
|
||||
|
||||
```diff
|
||||
- name: multiple host
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
- host: ”foo.com“
|
||||
+ host: ”foo.com,bar.com“
|
||||
@ -212,11 +213,24 @@ ssh-keygen -t ed25519 -a 200 -C ”your_email@example.com“
|
||||
ls -al
|
||||
```
|
||||
|
||||
#### Commands from a file
|
||||
|
||||
```yaml
|
||||
- name: file commands
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
script_path: scripts/script.sh
|
||||
```
|
||||
|
||||
#### 多个不同端口的主机
|
||||
|
||||
```diff
|
||||
- name: multiple host
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
- host: ”foo.com“
|
||||
+ host: ”foo.com:1234,bar.com:5678“
|
||||
@ -231,7 +245,7 @@ ssh-keygen -t ed25519 -a 200 -C ”your_email@example.com“
|
||||
|
||||
```diff
|
||||
- name: multiple host
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ”foo.com,bar.com“
|
||||
+ sync: true
|
||||
@ -247,7 +261,7 @@ ssh-keygen -t ed25519 -a 200 -C ”your_email@example.com“
|
||||
|
||||
```diff
|
||||
- name: pass environment
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
+ env:
|
||||
+ FOO: ”BAR“
|
||||
+ BAR: ”FOO“
|
||||
@ -272,7 +286,7 @@ _在 `env` 对象中,您需要将每个环境变量作为字符串传递,传
|
||||
|
||||
```diff
|
||||
- name: stop script if command error
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -325,7 +339,7 @@ Host FooServer
|
||||
|
||||
```diff
|
||||
- name: ssh proxy command
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -346,7 +360,7 @@ Host FooServer
|
||||
|
||||
```diff
|
||||
- name: ssh key passphrase
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -372,7 +386,7 @@ ssh example.com ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub | cut -d ’
|
||||
|
||||
```diff
|
||||
- name: ssh key passphrase
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
|
@ -24,6 +24,7 @@
|
||||
* `key_path` - SSH 私鑰的路徑
|
||||
* `fingerprint` - 主機公鑰的 SHA256 指紋,預設為略過驗證
|
||||
* `script` - 執行命令
|
||||
* `script_file` - 執行命令的文件
|
||||
* `script_stop` - 當出現第一個錯誤時停止執行命令
|
||||
* `envs` - 傳遞環境變數到 shell script
|
||||
* `debug` - 啟用偵錯模式
|
||||
@ -58,7 +59,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: executing remote ssh commands using password
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -74,9 +75,9 @@ jobs:
|
||||
whoami
|
||||
======END======
|
||||
out: ***
|
||||
==============================================
|
||||
✅ Successfully executed commands to all host.
|
||||
==============================================
|
||||
===============================================
|
||||
✅ Successfully executed commands to all hosts.
|
||||
===============================================
|
||||
```
|
||||
|
||||
### 設置 SSH 金鑰
|
||||
@ -157,7 +158,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||
```yaml
|
||||
- name: executing remote ssh commands using password
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -170,7 +171,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||
```yaml
|
||||
- name: executing remote ssh commands using ssh key
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -183,7 +184,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||
```yaml
|
||||
- name: multiple command
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -196,11 +197,24 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||

|
||||
|
||||
#### Commands from a file
|
||||
|
||||
```yaml
|
||||
- name: file commands
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
script_path: scripts/script.sh
|
||||
```
|
||||
|
||||
#### 多台主機
|
||||
|
||||
```diff
|
||||
- name: multiple host
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
- host: "foo.com"
|
||||
+ host: "foo.com,bar.com"
|
||||
@ -216,7 +230,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||
```diff
|
||||
- name: multiple host
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
- host: "foo.com"
|
||||
+ host: "foo.com:1234,bar.com:5678"
|
||||
@ -231,7 +245,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||
```diff
|
||||
- name: multiple host
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: "foo.com,bar.com"
|
||||
+ sync: true
|
||||
@ -247,7 +261,7 @@ ssh-keygen -t ed25519 -a 200 -C "your_email@example.com"
|
||||
|
||||
```diff
|
||||
- name: pass environment
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
+ env:
|
||||
+ FOO: "BAR"
|
||||
+ BAR: "FOO"
|
||||
@ -272,7 +286,7 @@ _在 `env` 對象中,您需要將每個環境變量作為字符串傳遞,傳
|
||||
|
||||
```diff
|
||||
- name: stop script if command error
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -325,7 +339,7 @@ Host FooServer
|
||||
|
||||
```diff
|
||||
- name: ssh proxy command
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -346,7 +360,7 @@ Host FooServer
|
||||
|
||||
```diff
|
||||
- name: ssh key passphrase
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
@ -372,7 +386,7 @@ ssh example.com ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub | cut -d ' '
|
||||
|
||||
```diff
|
||||
- name: ssh key passphrase
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
|
@ -43,6 +43,9 @@ inputs:
|
||||
description: "SSH proxy username."
|
||||
proxy_password:
|
||||
description: "SSH proxy password."
|
||||
proxy_protocol:
|
||||
description: 'The IP protocol to use. Valid values are "tcp". "tcp4" or "tcp6". Default to tcp.'
|
||||
default: "tcp"
|
||||
proxy_passphrase:
|
||||
description: "SSH proxy key passphrase."
|
||||
proxy_timeout:
|
||||
@ -60,6 +63,8 @@ inputs:
|
||||
description: "Include more ciphers for the proxy by using insecure ciphers."
|
||||
script:
|
||||
description: "Commands to be executed."
|
||||
script_path:
|
||||
description: "Path to the file containing commands to be executed."
|
||||
script_stop:
|
||||
description: "Stop the script after the first failure."
|
||||
envs:
|
||||
@ -107,6 +112,7 @@ runs:
|
||||
INPUT_PROXY_TIMEOUT: ${{ inputs.proxy_timeout }}
|
||||
INPUT_COMMAND_TIMEOUT: ${{ inputs.command_timeout }}
|
||||
INPUT_SCRIPT: ${{ inputs.script }}
|
||||
INPUT_SCRIPT_FILE: ${{ inputs.script_path }}
|
||||
INPUT_SCRIPT_STOP: ${{ inputs.script_stop }}
|
||||
INPUT_ENVS: ${{ inputs.envs }}
|
||||
INPUT_ENVS_FORMAT: ${{ inputs.envs_format }}
|
||||
|
@ -8,7 +8,7 @@ export GITHUB="true"
|
||||
|
||||
GITHUB_ACTION_PATH="${GITHUB_ACTION_PATH%/}"
|
||||
DRONE_SSH_RELEASE_URL="${DRONE_SSH_RELEASE_URL:-https://github.com/appleboy/drone-ssh/releases/download}"
|
||||
DRONE_SSH_VERSION="${DRONE_SSH_VERSION:-1.7.7}"
|
||||
DRONE_SSH_VERSION="${DRONE_SSH_VERSION:-1.8.0}"
|
||||
|
||||
function detect_client_info() {
|
||||
if [ -n "${SSH_CLIENT_OS-}" ]; then
|
||||
@ -17,20 +17,21 @@ function detect_client_info() {
|
||||
local kernel
|
||||
kernel="$(uname -s)"
|
||||
case "${kernel}" in
|
||||
Darwin)
|
||||
CLIENT_PLATFORM="darwin"
|
||||
;;
|
||||
Linux)
|
||||
CLIENT_PLATFORM="linux"
|
||||
;;
|
||||
Windows)
|
||||
CLIENT_PLATFORM="windows"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown, unsupported platform: ${kernel}." >&2
|
||||
echo "Supported platforms: Linux, Darwin and Windows." >&2
|
||||
echo "Bailing out." >&2
|
||||
exit 2
|
||||
Darwin)
|
||||
CLIENT_PLATFORM="darwin"
|
||||
;;
|
||||
Linux)
|
||||
CLIENT_PLATFORM="linux"
|
||||
;;
|
||||
Windows)
|
||||
CLIENT_PLATFORM="windows"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown, unsupported platform: ${kernel}." >&2
|
||||
echo "Supported platforms: Linux, Darwin and Windows." >&2
|
||||
echo "Bailing out." >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@ -40,18 +41,18 @@ function detect_client_info() {
|
||||
local machine
|
||||
machine="$(uname -m)"
|
||||
case "${machine}" in
|
||||
x86_64*|i?86_64*|amd64*)
|
||||
CLIENT_ARCH="amd64"
|
||||
;;
|
||||
aarch64*|arm64*)
|
||||
CLIENT_ARCH="arm64"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown, unsupported architecture (${machine})." >&2
|
||||
echo "Supported architectures x86_64, i686, arm64." >&2
|
||||
echo "Bailing out." >&2
|
||||
exit 3
|
||||
;;
|
||||
x86_64* | i?86_64* | amd64*)
|
||||
CLIENT_ARCH="amd64"
|
||||
;;
|
||||
aarch64* | arm64*)
|
||||
CLIENT_ARCH="arm64"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown, unsupported architecture (${machine})." >&2
|
||||
echo "Supported architectures x86_64, i686, arm64." >&2
|
||||
echo "Bailing out." >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
3
testdata/test.sh
vendored
Normal file
3
testdata/test.sh
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
whoami
|
Reference in New Issue
Block a user