mirror of
https://github.com/appleboy/drone-ssh.git
synced 2026-06-16 14:49:25 +08:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c5d17d83d | |||
| 050e0e6efd | |||
| f01d5d9454 | |||
| c004469746 | |||
| bc2dac669a | |||
| 541508632d | |||
| 22cd751b47 | |||
| 5a6a923356 | |||
| 1a95b5f1b3 | |||
| d0ed2bb2fb | |||
| b2a60a2fec | |||
| 7c7619ebbc | |||
| fc62fb377c | |||
| 808373f717 | |||
| 6d9d6acc6a | |||
| 439ca59b8f | |||
| d9493e4563 | |||
| cc7a2d5983 | |||
| 0a6e4de21c | |||
| 48f817effb |
@@ -1,24 +0,0 @@
|
|||||||
name: Release Binary
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: techknowlogick/xgo:go-1.19.x
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
# - name: Release binary
|
|
||||||
# run: |
|
|
||||||
# ls -al
|
|
||||||
# make release
|
|
||||||
@@ -6,13 +6,16 @@ on:
|
|||||||
- master
|
- master
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '^1'
|
go-version: '^1'
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -23,16 +26,12 @@ jobs:
|
|||||||
- name: Build binary
|
- name: Build binary
|
||||||
run : |
|
run : |
|
||||||
make build_linux_amd64
|
make build_linux_amd64
|
||||||
make build_linux_arm64
|
|
||||||
make build_linux_arm
|
make build_linux_arm
|
||||||
|
make build_linux_arm64
|
||||||
- name: Check binary
|
|
||||||
run : |
|
|
||||||
./release/linux/amd64/drone-ssh --help
|
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
@@ -53,86 +52,26 @@ jobs:
|
|||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Docker meta for linux amd64
|
name: Docker meta
|
||||||
id: meta-linux-amd64
|
id: docker-meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
flavor: |
|
|
||||||
latest=false
|
|
||||||
suffix=linux-amd64
|
|
||||||
images: |
|
images: |
|
||||||
appleboy/drone-ssh
|
${{ github.repository }}
|
||||||
ghcr.io/appleboy/drone-ssh
|
ghcr.io/${{ github.repository }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=,enable={{is_default_branch}}
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
type=raw,value=latest,suffix=,enable={{is_default_branch}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,event=tag,pattern={{version}},suffix=-linux-amd64
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=semver,event=tag,pattern={{major}}.{{minor}},suffix=-linux-amd64
|
type=semver,pattern={{major}}
|
||||||
type=semver,event=tag,pattern={{major}},suffix=-linux-amd64
|
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Build and push linux amd64
|
name: Build and push
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: docker/Dockerfile.linux.amd64
|
platforms: linux/amd64,linux/arm,linux/arm64
|
||||||
platforms: linux/amd64
|
file: docker/Dockerfile
|
||||||
push: true
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta-linux-amd64.outputs.tags }}
|
tags: ${{ steps.docker-meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta-linux-amd64.outputs.labels }}
|
labels: ${{ steps.docker-meta.outputs.labels }}
|
||||||
|
|
||||||
-
|
|
||||||
name: Docker meta for linux arm64
|
|
||||||
id: meta-linux-arm64
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
flavor: |
|
|
||||||
latest=false
|
|
||||||
suffix=linux-arm64
|
|
||||||
images: |
|
|
||||||
appleboy/drone-ssh
|
|
||||||
ghcr.io/appleboy/drone-ssh
|
|
||||||
tags: |
|
|
||||||
type=raw,value=,enable={{is_default_branch}}
|
|
||||||
type=semver,event=tag,pattern={{version}},suffix=-linux-arm64
|
|
||||||
type=semver,event=tag,pattern={{major}}.{{minor}},suffix=-linux-arm64
|
|
||||||
type=semver,event=tag,pattern={{major}},suffix=-linux-arm64
|
|
||||||
|
|
||||||
-
|
|
||||||
name: Build and push linux arm64
|
|
||||||
uses: docker/build-push-action@v3
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: docker/Dockerfile.linux.arm64
|
|
||||||
platforms: linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta-linux-arm64.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta-linux-arm64.outputs.labels }}
|
|
||||||
|
|
||||||
-
|
|
||||||
name: Docker meta for linux arm
|
|
||||||
id: meta-linux-arm
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
flavor: |
|
|
||||||
latest=false
|
|
||||||
suffix=linux-arm
|
|
||||||
images: |
|
|
||||||
appleboy/drone-ssh
|
|
||||||
ghcr.io/appleboy/drone-ssh
|
|
||||||
tags: |
|
|
||||||
type=raw,value=,enable={{is_default_branch}}
|
|
||||||
type=semver,event=tag,pattern={{version}},suffix=-linux-arm
|
|
||||||
type=semver,event=tag,pattern={{major}}.{{minor}},suffix=-linux-arm
|
|
||||||
type=semver,event=tag,pattern={{major}},suffix=-linux-arm
|
|
||||||
|
|
||||||
-
|
|
||||||
name: Build and push linux arm
|
|
||||||
uses: docker/build-push-action@v3
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: docker/Dockerfile.linux.arm
|
|
||||||
platforms: linux/arm
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta-linux-arm.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta-linux-arm.outputs.labels }}
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
name: Setup go
|
name: Setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '^1'
|
go-version: '^1'
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '^1'
|
go-version: '^1'
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -20,18 +20,10 @@ jobs:
|
|||||||
version: latest
|
version: latest
|
||||||
args: --verbose
|
args: --verbose
|
||||||
|
|
||||||
- uses: hadolint/hadolint-action@v3.0.0
|
- uses: hadolint/hadolint-action@v3.1.0
|
||||||
name: hadolint for Dockerfile.linux.amd64
|
name: hadolint for Dockerfile
|
||||||
with:
|
with:
|
||||||
dockerfile: docker/Dockerfile.linux.amd64
|
dockerfile: docker/Dockerfile
|
||||||
- uses: hadolint/hadolint-action@v3.0.0
|
|
||||||
name: hadolint for Dockerfile.linux.arm64
|
|
||||||
with:
|
|
||||||
dockerfile: docker/Dockerfile.linux.arm64
|
|
||||||
- uses: hadolint/hadolint-action@v3.0.0
|
|
||||||
name: hadolint for Dockerfile.linux.arm
|
|
||||||
with:
|
|
||||||
dockerfile: docker/Dockerfile.linux.arm
|
|
||||||
|
|
||||||
testing:
|
testing:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy
|
||||||
|
|
||||||
|
builds:
|
||||||
|
- env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
goos:
|
||||||
|
- darwin
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
- freebsd
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
goarm:
|
||||||
|
- "5"
|
||||||
|
- "6"
|
||||||
|
- "7"
|
||||||
|
ignore:
|
||||||
|
- goos: darwin
|
||||||
|
goarch: arm
|
||||||
|
- goos: darwin
|
||||||
|
goarch: ppc64le
|
||||||
|
- goos: darwin
|
||||||
|
goarch: s390x
|
||||||
|
- goos: windows
|
||||||
|
goarch: ppc64le
|
||||||
|
- goos: windows
|
||||||
|
goarch: s390x
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm
|
||||||
|
goarm: "5"
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm
|
||||||
|
goarm: "6"
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm
|
||||||
|
goarm: "7"
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm64
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: ppc64le
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: s390x
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: arm
|
||||||
|
goarm: "5"
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: arm
|
||||||
|
goarm: "6"
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: arm
|
||||||
|
goarm: "7"
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: arm64
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
ldflags:
|
||||||
|
- -s -w
|
||||||
|
- -X main.Version={{.Version}}
|
||||||
|
binary: >-
|
||||||
|
{{ .ProjectName }}-
|
||||||
|
{{- if .IsSnapshot }}{{ .Branch }}-
|
||||||
|
{{- else }}{{- .Version }}-{{ end }}
|
||||||
|
{{- .Os }}-
|
||||||
|
{{- if eq .Arch "amd64" }}amd64
|
||||||
|
{{- else if eq .Arch "amd64_v1" }}amd64
|
||||||
|
{{- else if eq .Arch "386" }}386
|
||||||
|
{{- else }}{{ .Arch }}{{ end }}
|
||||||
|
{{- if .Arm }}-{{ .Arm }}{{ end }}
|
||||||
|
no_unique_dist_dir: true
|
||||||
|
|
||||||
|
archives:
|
||||||
|
- format: binary
|
||||||
|
name_template: "{{ .Binary }}"
|
||||||
|
allow_different_binary_count: true
|
||||||
|
|
||||||
|
checksum:
|
||||||
|
name_template: 'checksums.txt'
|
||||||
|
|
||||||
|
snapshot:
|
||||||
|
name_template: "{{ incpatch .Version }}"
|
||||||
@@ -5,14 +5,14 @@ author: appleboy
|
|||||||
tags: [ deploy, publish, ssh ]
|
tags: [ deploy, publish, ssh ]
|
||||||
repo: appleboy/drone-ssh
|
repo: appleboy/drone-ssh
|
||||||
logo: term.svg
|
logo: term.svg
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
---
|
---
|
||||||
|
|
||||||
Use the SSH plugin to execute commands on a remote server. The below pipeline configuration demonstrates simple usage:
|
Use the SSH plugin to execute commands on a remote server. The below pipeline configuration demonstrates simple usage:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: ssh commands
|
- name: ssh commands
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host: foo.com
|
host: foo.com
|
||||||
username: root
|
username: root
|
||||||
@@ -27,7 +27,7 @@ Example configuration in your `.drone.yml` file for multiple hosts:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
- name: ssh commands
|
- name: ssh commands
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host:
|
host:
|
||||||
+ - foo.com
|
+ - foo.com
|
||||||
@@ -44,7 +44,7 @@ Example configuration for multiple hosts with different port:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
- name: ssh commands
|
- name: ssh commands
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host:
|
host:
|
||||||
+ - foo.com:1234
|
+ - foo.com:1234
|
||||||
@@ -61,7 +61,7 @@ Example configuration for command timeout, default value is 60 seconds:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
- name: ssh commands
|
- name: ssh commands
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host: foo.com
|
host: foo.com
|
||||||
username: root
|
username: root
|
||||||
@@ -77,7 +77,7 @@ Example configuration for execute commands on a remote server using `SSHProxyC
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
- name: ssh commands
|
- name: ssh commands
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host: foo.com
|
host: foo.com
|
||||||
username: root
|
username: root
|
||||||
@@ -96,7 +96,7 @@ Example configuration using password from secrets:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
- name: ssh commands
|
- name: ssh commands
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host: foo.com
|
host: foo.com
|
||||||
username: root
|
username: root
|
||||||
@@ -112,7 +112,7 @@ Example configuration using ssh key from secrets:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
- name: ssh commands
|
- name: ssh commands
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host: foo.com
|
host: foo.com
|
||||||
username: root
|
username: root
|
||||||
@@ -128,7 +128,7 @@ Example configuration for exporting custom secrets:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
- name: ssh commands
|
- name: ssh commands
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
environment:
|
environment:
|
||||||
commit: ${DRONE_BUILD_NUMBER}
|
commit: ${DRONE_BUILD_NUMBER}
|
||||||
settings:
|
settings:
|
||||||
@@ -148,7 +148,7 @@ Example configuration for stoping script after first failure:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
- name: ssh commands
|
- name: ssh commands
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host: foo.com
|
host: foo.com
|
||||||
username: root
|
username: root
|
||||||
@@ -164,7 +164,7 @@ Example configuration for passphrase which protecting a private key:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
- name: ssh commands
|
- name: ssh commands
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host: foo.com
|
host: foo.com
|
||||||
username: root
|
username: root
|
||||||
@@ -179,79 +179,35 @@ Example configuration for passphrase which protecting a private key:
|
|||||||
|
|
||||||
## Secret Reference
|
## Secret Reference
|
||||||
|
|
||||||
ssh_username
|
| Key | Description |
|
||||||
: account for target host user
|
|-----|-------------|
|
||||||
|
| `ssh_username` | account for target host user |
|
||||||
ssh_password
|
| `ssh_password` | password for target host user | |
|
||||||
: password for target host user
|
| `ssh_passphrase` | The purpose of the passphrase is usually to encrypt the private key. |
|
||||||
|
| `ssh_key` | plain text of user private key |
|
||||||
ssh_passphrase
|
| `proxy_ssh_username` | account for user of proxy server |
|
||||||
: The purpose of the passphrase is usually to encrypt the private key.
|
| `proxy_ssh_password` | password for user of proxy server |
|
||||||
|
| `proxy_ssh_passphrase` | The purpose of the passphrase is usually to encrypt the private key. |
|
||||||
ssh_key
|
| `proxy_ssh_key` | plain text of user private key for proxy server |
|
||||||
: 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_passphrase
|
|
||||||
: The purpose of the passphrase is usually to encrypt the private key.
|
|
||||||
|
|
||||||
proxy_ssh_key
|
|
||||||
: plain text of user private key for proxy server
|
|
||||||
|
|
||||||
## Parameter Reference
|
## Parameter Reference
|
||||||
|
|
||||||
host
|
| Key | Description |
|
||||||
: target hostname or IP
|
|-----|-------------|
|
||||||
|
| `host` | target hostname or IP |
|
||||||
port
|
| `port` | ssh port of target host |
|
||||||
: ssh port of target host
|
| `username` | account for target host user |
|
||||||
|
| `password` | password for target host user |
|
||||||
username
|
| `key` | plain text of user private key |
|
||||||
: account for target host user
|
| `key_path` | key path of user private key |
|
||||||
|
| `envs` | custom secrets which are made available in the script section |
|
||||||
password
|
| `script` | execute commands on a remote server |
|
||||||
: password for target host user
|
| `script_stop` | stop script after first failure |
|
||||||
|
| `timeout` | Timeout is the maximum amount of time for the ssh connection to establish, default is 30 seconds. |
|
||||||
key
|
| `command_timeout` | Command timeout is the maximum amount of time for the execute commands, default is 10 minutes. |
|
||||||
: plain text of user private key
|
| `proxy_host` | proxy hostname or IP |
|
||||||
|
| `proxy_port` | ssh port of proxy host |
|
||||||
key_path
|
| `proxy_username` | account for proxy host user |
|
||||||
: key path of user private key
|
| `proxy_password` | password for proxy host user |
|
||||||
|
| `proxy_key` | plain text of proxy private key |
|
||||||
envs
|
| `proxy_key_path` | key path of proxy private key |
|
||||||
: custom secrets which are made available in the script section
|
|
||||||
|
|
||||||
script
|
|
||||||
: execute commands on a remote server
|
|
||||||
|
|
||||||
script_stop
|
|
||||||
: stop script after first failure
|
|
||||||
|
|
||||||
timeout
|
|
||||||
: Timeout is the maximum amount of time for the ssh connection to establish, default is 30 seconds.
|
|
||||||
|
|
||||||
command_timeout
|
|
||||||
: Command timeout is the maximum amount of time for the execute commands, default is 10 minutes.
|
|
||||||
|
|
||||||
proxy_host
|
|
||||||
: proxy hostname or IP
|
|
||||||
|
|
||||||
proxy_port
|
|
||||||
: ssh port of proxy host
|
|
||||||
|
|
||||||
proxy_username
|
|
||||||
: account for proxy host user
|
|
||||||
|
|
||||||
proxy_password
|
|
||||||
: password for proxy host user
|
|
||||||
|
|
||||||
proxy_key
|
|
||||||
: plain text of proxy private key
|
|
||||||
|
|
||||||
proxy_key_path
|
|
||||||
: key path of proxy private key
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ information and a listing of the available options please take a look at [the do
|
|||||||
```diff
|
```diff
|
||||||
pipeline:
|
pipeline:
|
||||||
scp:
|
scp:
|
||||||
image: appleboy/drone-scp
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host:
|
host:
|
||||||
- example1.com
|
- example1.com
|
||||||
@@ -49,7 +49,7 @@ The pre-compiled binaries can be downloaded from [release page](https://github.c
|
|||||||
With `Go` installed
|
With `Go` installed
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
go get -u -v github.com/appleboy/drone-ssh
|
go install github.com/appleboy/drone-ssh@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
or build the binary with the following command:
|
or build the binary with the following command:
|
||||||
@@ -85,7 +85,7 @@ docker run --rm \
|
|||||||
-e PLUGIN_SCRIPT=whoami \
|
-e PLUGIN_SCRIPT=whoami \
|
||||||
-v $(pwd):$(pwd) \
|
-v $(pwd):$(pwd) \
|
||||||
-w $(pwd) \
|
-w $(pwd) \
|
||||||
appleboy/drone-ssh
|
ghcr.io/appleboy/drone-ssh
|
||||||
```
|
```
|
||||||
|
|
||||||
## Mount key from file path
|
## Mount key from file path
|
||||||
@@ -99,7 +99,7 @@ Mount private key in `volumes` setting of `.drone.yml` config
|
|||||||
```diff
|
```diff
|
||||||
pipeline:
|
pipeline:
|
||||||
ssh:
|
ssh:
|
||||||
image: appleboy/drone-ssh
|
image: ghcr.io/appleboy/drone-ssh
|
||||||
host: xxxxx.com
|
host: xxxxx.com
|
||||||
username: deploy
|
username: deploy
|
||||||
+ volumes:
|
+ volumes:
|
||||||
@@ -110,3 +110,15 @@ pipeline:
|
|||||||
```
|
```
|
||||||
|
|
||||||
See the detail of [issue comment](https://github.com/appleboy/drone-ssh/issues/51#issuecomment-336732928).
|
See the detail of [issue comment](https://github.com/appleboy/drone-ssh/issues/51#issuecomment-336732928).
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
See [DOCS.md](./DOCS.md) for examples and full configuration options
|
||||||
|
|
||||||
|
Configuration options are loaded from multiple sources:
|
||||||
|
|
||||||
|
0. Hardcoded drone-ssh defaults. See [main.go CLI Flags](https://github.com/appleboy/drone-ssh/blob/6d9d6acc6aef1f9166118c6ba8bd214d3a582bdb/main.go#L39) for more information.
|
||||||
|
1. From a dotenv file at a path specified by the `PLUGIN_ENV_FILE` environment variable.
|
||||||
|
2. From your `.drone.yml` Drone configuration.
|
||||||
|
|
||||||
|
Later sources override previous sources, i.e. if `PORT` is set in an `.env` file committed in the repository or created by previous test steps, it will override the default set `main.go`.
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
FROM plugins/base:linux-amd64
|
FROM alpine:3.17
|
||||||
|
|
||||||
|
ARG TARGETOS
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
|
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
|
||||||
org.label-schema.name="Drone SSH" \
|
org.label-schema.name="SSH Plugin" \
|
||||||
org.label-schema.vendor="Bo-Yi Wu" \
|
org.label-schema.vendor="Bo-Yi Wu" \
|
||||||
org.label-schema.schema-version="1.0"
|
org.label-schema.schema-version="1.0"
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates && \
|
RUN apk add --no-cache ca-certificates && \
|
||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
COPY release/linux/amd64/drone-ssh /bin/
|
COPY release/${TARGETOS}/${TARGETARCH}/drone-ssh /bin/
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/drone-ssh"]
|
ENTRYPOINT ["/bin/drone-ssh"]
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
FROM plugins/base:linux-arm
|
|
||||||
|
|
||||||
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
|
|
||||||
org.label-schema.name="Drone SSH" \
|
|
||||||
org.label-schema.vendor="Bo-Yi Wu" \
|
|
||||||
org.label-schema.schema-version="1.0"
|
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates && \
|
|
||||||
rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
COPY release/linux/arm/drone-ssh /bin/
|
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/drone-ssh"]
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
FROM plugins/base:linux-arm64
|
|
||||||
|
|
||||||
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
|
|
||||||
org.label-schema.name="Drone SSH" \
|
|
||||||
org.label-schema.vendor="Bo-Yi Wu" \
|
|
||||||
org.label-schema.schema-version="1.0"
|
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates && \
|
|
||||||
rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
COPY release/linux/arm64/drone-ssh /bin/
|
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/drone-ssh"]
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
FROM microsoft/nanoserver:10.0.14393.1884
|
|
||||||
|
|
||||||
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
|
|
||||||
org.label-schema.name="Drone SSH" \
|
|
||||||
org.label-schema.vendor="Bo-Yi Wu" \
|
|
||||||
org.label-schema.schema-version="1.0"
|
|
||||||
|
|
||||||
ADD drone-ssh.exe /drone-ssh.exe
|
|
||||||
ENTRYPOINT [ "\\drone-ssh.exe" ]
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
image: appleboy/drone-ssh:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
|
|
||||||
{{#if build.tags}}
|
|
||||||
tags:
|
|
||||||
{{#each build.tags}}
|
|
||||||
- {{this}}
|
|
||||||
{{/each}}
|
|
||||||
{{/if}}
|
|
||||||
manifests:
|
|
||||||
-
|
|
||||||
image: appleboy/drone-ssh:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
|
|
||||||
platform:
|
|
||||||
architecture: amd64
|
|
||||||
os: linux
|
|
||||||
-
|
|
||||||
image: appleboy/drone-ssh:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
|
|
||||||
platform:
|
|
||||||
architecture: arm64
|
|
||||||
os: linux
|
|
||||||
variant: v8
|
|
||||||
-
|
|
||||||
image: appleboy/drone-ssh:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
|
|
||||||
platform:
|
|
||||||
architecture: arm
|
|
||||||
os: linux
|
|
||||||
variant: v7
|
|
||||||
@@ -4,10 +4,10 @@ go 1.18
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/appleboy/easyssh-proxy v1.3.9
|
github.com/appleboy/easyssh-proxy v1.3.9
|
||||||
github.com/joho/godotenv v1.4.0
|
github.com/joho/godotenv v1.5.1
|
||||||
github.com/stretchr/testify v1.8.1
|
github.com/stretchr/testify v1.8.1
|
||||||
github.com/urfave/cli/v2 v2.23.7
|
github.com/urfave/cli/v2 v2.25.1
|
||||||
golang.org/x/crypto v0.4.0
|
golang.org/x/crypto v0.7.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -18,6 +18,6 @@ require (
|
|||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
||||||
golang.org/x/sys v0.3.0 // indirect
|
golang.org/x/sys v0.6.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
|||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a h1:saTgr5tMLFnmy/yg3qDTft4rE5DY2uJ/cCxCe3q0XTU=
|
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a h1:saTgr5tMLFnmy/yg3qDTft4rE5DY2uJ/cCxCe3q0XTU=
|
||||||
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a/go.mod h1:Bw9BbhOJVNR+t0jCqx2GC6zv0TGBsShs56Y3gfSCvl0=
|
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a/go.mod h1:Bw9BbhOJVNR+t0jCqx2GC6zv0TGBsShs56Y3gfSCvl0=
|
||||||
github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg=
|
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||||
github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||||
@@ -25,24 +25,24 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
|||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY=
|
github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw=
|
||||||
github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
|
github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
|
||||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
|
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
|
||||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||||
golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8=
|
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
||||||
golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80=
|
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
|
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
||||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||||
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
|
golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
|
|
||||||
"github.com/appleboy/easyssh-proxy"
|
"github.com/appleboy/easyssh-proxy"
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
_ "github.com/joho/godotenv/autoload"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ var (
|
|||||||
errMissingHost = errors.New("Error: missing server host")
|
errMissingHost = errors.New("Error: missing server host")
|
||||||
errMissingPasswordOrKey = errors.New("Error: can't connect without a private SSH key or password")
|
errMissingPasswordOrKey = errors.New("Error: can't connect without a private SSH key or password")
|
||||||
errCommandTimeOut = errors.New("Error: command timeout")
|
errCommandTimeOut = errors.New("Error: command timeout")
|
||||||
errSetPasswordandKey = errors.New("can't set password and key at the same time")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@@ -103,7 +102,7 @@ func (p Plugin) exec(host string, wg *sync.WaitGroup, errChannel chan error) {
|
|||||||
for _, key := range p.Config.Envs {
|
for _, key := range p.Config.Envs {
|
||||||
key = strings.ToUpper(key)
|
key = strings.ToUpper(key)
|
||||||
if val, found := os.LookupEnv(key); found {
|
if val, found := os.LookupEnv(key); found {
|
||||||
env = append(env, key+"="+escapeArg(val))
|
env = append(env, "export "+key+"="+escapeArg(val))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,10 +172,6 @@ func (p Plugin) Exec() error {
|
|||||||
return errMissingPasswordOrKey
|
return errMissingPasswordOrKey
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(p.Config.Key) != 0 && len(p.Config.Password) != 0 {
|
|
||||||
return errSetPasswordandKey
|
|
||||||
}
|
|
||||||
|
|
||||||
wg := sync.WaitGroup{}
|
wg := sync.WaitGroup{}
|
||||||
wg.Add(len(p.Config.Host))
|
wg.Add(len(p.Config.Host))
|
||||||
errChannel := make(chan error)
|
errChannel := make(chan error)
|
||||||
|
|||||||
+7
-24
@@ -38,23 +38,6 @@ func TestMissingKeyOrPassword(t *testing.T) {
|
|||||||
assert.Equal(t, errMissingPasswordOrKey, err)
|
assert.Equal(t, errMissingPasswordOrKey, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSetPasswordAndKey(t *testing.T) {
|
|
||||||
plugin := Plugin{
|
|
||||||
Config{
|
|
||||||
Host: []string{"localhost"},
|
|
||||||
Username: "ubuntu",
|
|
||||||
Password: "1234",
|
|
||||||
Key: "1234",
|
|
||||||
},
|
|
||||||
os.Stdout,
|
|
||||||
}
|
|
||||||
|
|
||||||
err := plugin.Exec()
|
|
||||||
|
|
||||||
assert.NotNil(t, err)
|
|
||||||
assert.Equal(t, errSetPasswordandKey, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestIncorrectPassword(t *testing.T) {
|
func TestIncorrectPassword(t *testing.T) {
|
||||||
plugin := Plugin{
|
plugin := Plugin{
|
||||||
Config: Config{
|
Config: Config{
|
||||||
@@ -539,13 +522,13 @@ func TestEnvOutput(t *testing.T) {
|
|||||||
echo "[${ENV_7}]"
|
echo "[${ENV_7}]"
|
||||||
======END======
|
======END======
|
||||||
======ENV======
|
======ENV======
|
||||||
ENV_1='test'
|
export ENV_1='test'
|
||||||
ENV_2='test test'
|
export ENV_2='test test'
|
||||||
ENV_3='test '
|
export ENV_3='test '
|
||||||
ENV_4=' test test '
|
export ENV_4=' test test '
|
||||||
ENV_5='test'\'''
|
export ENV_5='test'\'''
|
||||||
ENV_6='test"'
|
export ENV_6='test"'
|
||||||
ENV_7='test,!#;?.@$~'\''"'
|
export ENV_7='test,!#;?.@$~'\''"'
|
||||||
======END======
|
======END======
|
||||||
out: [test]
|
out: [test]
|
||||||
out: [test test]
|
out: [test test]
|
||||||
|
|||||||
Reference in New Issue
Block a user