Compare commits

...

12 Commits

Author SHA1 Message Date
Bo-Yi Wu c8ecc03ef5 Revert "chore(scripts): disable SliceFlagSeparator" (#215) 2022-12-27 08:25:11 +08:00
Bo-Yi Wu ddf9ca3e6f chore(scripts): disable SliceFlagSeparator (#212) 2022-12-25 15:48:42 +08:00
Bo-Yi Wu a568d2e551 chore(cli): upgrade urfave/cli to v2 (#211) 2022-12-25 15:44:30 +08:00
Bo-Yi Wu d17a10dd0c Revert "chore(cli): upgrade urfave/cli to v2" (#210) 2022-12-25 15:15:55 +08:00
Bo-Yi Wu d83798f25b chore(cli): upgrade urfave/cli to v2 (#152) 2022-12-25 14:56:47 +08:00
Bo-Yi.Wu 59b08e1b4c chore(CI): Add Codecov
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 14:32:58 +08:00
Bo-Yi.Wu 8d07792340 chore(CI): replace go get with go install
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 14:27:10 +08:00
Bo-Yi.Wu 55bebcef3d chore(CI): add sshd service and testing
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 14:21:18 +08:00
Bo-Yi.Wu dfa002a267 chore(CI): release binary
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 11:12:32 +08:00
Bo-Yi.Wu 60da6458b5 docs(readme): remove drone badge
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 10:02:55 +08:00
Bo-Yi.Wu fe2455ee6d chore(CI): rename
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 10:01:25 +08:00
Bo-Yi.Wu d2cea88132 chore(CI): add hadolint checker
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 09:51:48 +08:00
9 changed files with 213 additions and 151 deletions
+24
View File
@@ -0,0 +1,24 @@
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
@@ -1,4 +1,4 @@
name: Release Binary name: Docker Image
on: on:
push: push:
+33 -5
View File
@@ -1,12 +1,8 @@
name: Run Lint name: Lint and Testing
on: on:
push: push:
branches:
- master
pull_request: pull_request:
branches:
- master
jobs: jobs:
lint: lint:
@@ -23,3 +19,35 @@ jobs:
with: with:
version: latest version: latest
args: --verbose args: --verbose
- uses: hadolint/hadolint-action@v3.0.0
name: hadolint for Dockerfile.linux.amd64
with:
dockerfile: docker/Dockerfile.linux.amd64
- 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:
runs-on: ubuntu-latest
container: golang:1.19-alpine
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: setup sshd server
run: |
apk add git make curl perl bash build-base zlib-dev ucl-dev
make ssh-server
- name: testing
run: |
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
+2
View File
@@ -0,0 +1,2 @@
ignored:
- DL3018
+14 -13
View File
@@ -1,18 +1,19 @@
DIST := dist DIST := dist
EXECUTABLE := drone-ssh EXECUTABLE := drone-ssh
GOFMT ?= gofumpt -l -s GOFMT ?= gofumpt -l
DIST := dist DIST := dist
DIST_DIRS := $(DIST)/binaries $(DIST)/release DIST_DIRS := $(DIST)/binaries $(DIST)/release
GO ?= go GO ?= go
SHASUM ?= shasum -a 256 SHASUM ?= shasum -a 256
GOFILES := $(shell find . -name "*.go" -type f)
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" ) HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
XGO_VERSION := go-1.18.x XGO_VERSION := go-1.19.x
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.10 GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
LINUX_ARCHS ?= linux/amd64,linux/arm64 LINUX_ARCHS ?= linux/amd64,linux/arm64
DARWIN_ARCHS ?= darwin-12/amd64,darwin-12/arm64 DARWIN_ARCHS ?= darwin-10.12/amd64,darwin-10.12/arm64
WINDOWS_ARCHS ?= windows/amd64 WINDOWS_ARCHS ?= windows/*
ifneq ($(shell uname), Darwin) ifneq ($(shell uname), Darwin)
EXTLDFLAGS = -extldflags "-static" $(null) EXTLDFLAGS = -extldflags "-static" $(null)
@@ -52,9 +53,9 @@ all: build
fmt: fmt:
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u mvdan.cc/gofumpt; \ $(GO) install mvdan.cc/gofumpt; \
fi fi
$(GOFMT) -w $(SOURCES) $(GOFMT) -w $(GOFILES)
vet: vet:
$(GO) vet ./... $(GO) vet ./...
@@ -62,24 +63,24 @@ vet:
.PHONY: fmt-check .PHONY: fmt-check
fmt-check: fmt-check:
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u mvdan.cc/gofumpt; \ $(GO) install mvdan.cc/gofumpt; \
fi fi
@diff=$$($(GOFMT) -d $(SOURCES)); \ @diff=$$($(GOFMT) -d $(GOFILES)); \
if [ -n "$$diff" ]; then \ if [ -n "$$diff" ]; then \
echo "Please run 'make fmt' and commit the result:"; \ echo "Please run 'make fmt' and commit the result:"; \
echo "$${diff}"; \ echo "$${diff}"; \
exit 1; \ exit 1; \
fi; fi;
test: fmt-check test:
@$(GO) test -v -cover -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1 @$(GO) test -v -cover -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1
install: $(SOURCES) install: $(GOFILES)
$(GO) install -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' $(GO) install -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)'
build: $(EXECUTABLE) build: $(EXECUTABLE)
$(EXECUTABLE): $(SOURCES) $(EXECUTABLE): $(GOFILES)
$(GO) build -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o $@ $(GO) build -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o $@
build_linux_amd64: build_linux_amd64:
@@ -119,7 +120,7 @@ deps-backend:
$(GO) install $(XGO_PACKAGE) $(GO) install $(XGO_PACKAGE)
.PHONY: release .PHONY: release
release: release-linux release-copy release-compress release-check release: release-linux release-darwin release-windows release-copy release-compress release-check
$(DIST_DIRS): $(DIST_DIRS):
mkdir -p $(DIST_DIRS) mkdir -p $(DIST_DIRS)
+1 -2
View File
@@ -4,11 +4,10 @@
[![GitHub tag](https://img.shields.io/github/tag/appleboy/drone-ssh.svg)](https://github.com/appleboy/drone-ssh/releases) [![GitHub tag](https://img.shields.io/github/tag/appleboy/drone-ssh.svg)](https://github.com/appleboy/drone-ssh/releases)
[![GoDoc](https://godoc.org/github.com/appleboy/drone-ssh?status.svg)](https://godoc.org/github.com/appleboy/drone-ssh) [![GoDoc](https://godoc.org/github.com/appleboy/drone-ssh?status.svg)](https://godoc.org/github.com/appleboy/drone-ssh)
[![Build Status](https://cloud.drone.io/api/badges/appleboy/drone-ssh/status.svg)](https://cloud.drone.io/appleboy/drone-ssh) [![Lint and Testing](https://github.com/appleboy/drone-ssh/actions/workflows/lint.yml/badge.svg)](https://github.com/appleboy/drone-ssh/actions/workflows/lint.yml)
[![codecov](https://codecov.io/gh/appleboy/drone-ssh/branch/master/graph/badge.svg)](https://codecov.io/gh/appleboy/drone-ssh) [![codecov](https://codecov.io/gh/appleboy/drone-ssh/branch/master/graph/badge.svg)](https://codecov.io/gh/appleboy/drone-ssh)
[![Go Report Card](https://goreportcard.com/badge/github.com/appleboy/drone-ssh)](https://goreportcard.com/report/github.com/appleboy/drone-ssh) [![Go Report Card](https://goreportcard.com/badge/github.com/appleboy/drone-ssh)](https://goreportcard.com/report/github.com/appleboy/drone-ssh)
[![Docker Pulls](https://img.shields.io/docker/pulls/appleboy/drone-ssh.svg)](https://hub.docker.com/r/appleboy/drone-ssh/) [![Docker Pulls](https://img.shields.io/docker/pulls/appleboy/drone-ssh.svg)](https://hub.docker.com/r/appleboy/drone-ssh/)
[![micro badger](https://images.microbadger.com/badges/image/appleboy/drone-ssh.svg)](https://microbadger.com/images/appleboy/drone-ssh "Get your own image badge on microbadger.com")
Drone plugin to execute commands on a remote host through SSH. For the usage Drone plugin to execute commands on a remote host through SSH. For the usage
information and a listing of the available options please take a look at [the docs](http://plugins.drone.io/appleboy/drone-ssh/). information and a listing of the available options please take a look at [the docs](http://plugins.drone.io/appleboy/drone-ssh/).
+2 -1
View File
@@ -6,7 +6,7 @@ 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.4.0
github.com/stretchr/testify v1.8.1 github.com/stretchr/testify v1.8.1
github.com/urfave/cli v1.22.10 github.com/urfave/cli/v2 v2.23.7
golang.org/x/crypto v0.4.0 golang.org/x/crypto v0.4.0
) )
@@ -17,6 +17,7 @@ require (
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect
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
golang.org/x/sys v0.3.0 // indirect golang.org/x/sys v0.3.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )
+4 -6
View File
@@ -1,10 +1,8 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o= github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o=
github.com/ScaleFT/sshkeys v1.2.0 h1:5BRp6rTVIhJzXT3VcUQrKgXR8zWA3sOsNeuyW15WUA8= github.com/ScaleFT/sshkeys v1.2.0 h1:5BRp6rTVIhJzXT3VcUQrKgXR8zWA3sOsNeuyW15WUA8=
github.com/ScaleFT/sshkeys v1.2.0/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o= github.com/ScaleFT/sshkeys v1.2.0/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o=
github.com/appleboy/easyssh-proxy v1.3.9 h1:b+sVSTz+cVFvfA23HQywMMpm0s5g3gH7jYdBcQqaCQI= github.com/appleboy/easyssh-proxy v1.3.9 h1:b+sVSTz+cVFvfA23HQywMMpm0s5g3gH7jYdBcQqaCQI=
github.com/appleboy/easyssh-proxy v1.3.9/go.mod h1:G1eQomBEME7NWKA3hE49s5HsT44S5fn0aBxX7k9Yjug= github.com/appleboy/easyssh-proxy v1.3.9/go.mod h1:G1eQomBEME7NWKA3hE49s5HsT44S5fn0aBxX7k9Yjug=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -16,10 +14,8 @@ github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg=
github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/joho/godotenv v1.4.0/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.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -29,8 +25,10 @@ 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 v1.22.10 h1:p8Fspmz3iTctJstry1PYS3HVdllxnEzTEsgIgtxTrCk= github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY=
github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.23.7/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/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=
+132 -123
View File
@@ -7,7 +7,8 @@ import (
"github.com/appleboy/easyssh-proxy" "github.com/appleboy/easyssh-proxy"
"github.com/joho/godotenv" "github.com/joho/godotenv"
"github.com/urfave/cli" _ "github.com/joho/godotenv/autoload"
"github.com/urfave/cli/v2"
) )
// Version set at compile-time // Version set at compile-time
@@ -27,7 +28,7 @@ func main() {
app.Name = "Drone SSH" app.Name = "Drone SSH"
app.Usage = "Executing remote ssh commands" app.Usage = "Executing remote ssh commands"
app.Copyright = "Copyright (c) 2019 Bo-Yi Wu" app.Copyright = "Copyright (c) 2019 Bo-Yi Wu"
app.Authors = []cli.Author{ app.Authors = []*cli.Author{
{ {
Name: "Bo-Yi Wu", Name: "Bo-Yi Wu",
Email: "appleboy.tw@gmail.com", Email: "appleboy.tw@gmail.com",
@@ -36,157 +37,165 @@ func main() {
app.Action = run app.Action = run
app.Version = Version app.Version = Version
app.Flags = []cli.Flag{ app.Flags = []cli.Flag{
cli.StringFlag{ &cli.StringFlag{
Name: "ssh-key", Name: "ssh-key",
Usage: "private ssh key", Usage: "private ssh key",
EnvVar: "PLUGIN_SSH_KEY,PLUGIN_KEY,SSH_KEY,KEY,INPUT_KEY", EnvVars: []string{"PLUGIN_SSH_KEY", "PLUGIN_KEY", "SSH_KEY", "KEY", "INPUT_KEY"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "ssh-passphrase", Name: "ssh-passphrase",
Usage: "The purpose of the passphrase is usually to encrypt the private key.", Usage: "The purpose of the passphrase is usually to encrypt the private key.",
EnvVar: "PLUGIN_SSH_PASSPHRASE,PLUGIN_PASSPHRASE,SSH_PASSPHRASE,PASSPHRASE,INPUT_PASSPHRASE", EnvVars: []string{"PLUGIN_SSH_PASSPHRASE", "PLUGIN_PASSPHRASE", "SSH_PASSPHRASE", "PASSPHRASE", "INPUT_PASSPHRASE"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "key-path,i", Name: "key-path",
Usage: "ssh private key path", Aliases: []string{"i"},
EnvVar: "PLUGIN_KEY_PATH,SSH_KEY_PATH,INPUT_KEY_PATH", Usage: "ssh private key path",
EnvVars: []string{"PLUGIN_KEY_PATH", "SSH_KEY_PATH", "INPUT_KEY_PATH"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "username,user,u", Name: "username",
Usage: "connect as user", Aliases: []string{"user", "u"},
EnvVar: "PLUGIN_USERNAME,PLUGIN_USER,SSH_USERNAME,USERNAME,INPUT_USERNAME", Usage: "connect as user",
Value: "root", EnvVars: []string{"PLUGIN_USERNAME", "PLUGIN_USER", "SSH_USERNAME", "USERNAME", "INPUT_USERNAME"},
Value: "root",
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "password,P", Name: "password",
Usage: "user password", Aliases: []string{"P"},
EnvVar: "PLUGIN_PASSWORD,SSH_PASSWORD,PASSWORD,INPUT_PASSWORD", Usage: "user password",
EnvVars: []string{"PLUGIN_PASSWORD", "SSH_PASSWORD", "PASSWORD", "INPUT_PASSWORD"},
}, },
cli.StringSliceFlag{ &cli.StringSliceFlag{
Name: "ciphers", Name: "ciphers",
Usage: "The allowed cipher algorithms. If unspecified then a sensible", Usage: "The allowed cipher algorithms. If unspecified then a sensible",
EnvVar: "PLUGIN_CIPHERS,SSH_CIPHERS,CIPHERS,INPUT_CIPHERS", EnvVars: []string{"PLUGIN_CIPHERS", "SSH_CIPHERS", "CIPHERS", "INPUT_CIPHERS"},
}, },
cli.BoolFlag{ &cli.BoolFlag{
Name: "useInsecureCipher", Name: "useInsecureCipher",
Usage: "include more ciphers with use_insecure_cipher", Usage: "include more ciphers with use_insecure_cipher",
EnvVar: "PLUGIN_USE_INSECURE_CIPHER,SSH_USE_INSECURE_CIPHER,USE_INSECURE_CIPHER,INPUT_USE_INSECURE_CIPHER", EnvVars: []string{"PLUGIN_USE_INSECURE_CIPHER", "SSH_USE_INSECURE_CIPHER", "USE_INSECURE_CIPHER", "INPUT_USE_INSECURE_CIPHER"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "fingerprint", Name: "fingerprint",
Usage: "fingerprint SHA256 of the host public key, default is to skip verification", Usage: "fingerprint SHA256 of the host public key, default is to skip verification",
EnvVar: "PLUGIN_FINGERPRINT,SSH_FINGERPRINT,FINGERPRINT,INPUT_FINGERPRINT", EnvVars: []string{"PLUGIN_FINGERPRINT", "SSH_FINGERPRINT", "FINGERPRINT", "INPUT_FINGERPRINT"},
}, },
cli.StringSliceFlag{ &cli.StringSliceFlag{
Name: "host,H", Name: "host",
Aliases: []string{"H"},
Usage: "connect to host", Usage: "connect to host",
EnvVar: "PLUGIN_HOST,SSH_HOST,HOST,INPUT_HOST", EnvVars: []string{"PLUGIN_HOST", "SSH_HOST", "HOST", "INPUT_HOST"},
FilePath: ".host", FilePath: ".host",
}, },
cli.IntFlag{ &cli.IntFlag{
Name: "port,p", Name: "port",
Usage: "connect to port", Aliases: []string{"p"},
EnvVar: "PLUGIN_PORT,SSH_PORT,PORT,INPUT_PORT", Usage: "connect to port",
Value: 22, EnvVars: []string{"PLUGIN_PORT", "SSH_PORT", "PORT", "INPUT_PORT"},
Value: 22,
}, },
cli.BoolFlag{ &cli.BoolFlag{
Name: "sync", Name: "sync",
Usage: "sync mode", Usage: "sync mode",
EnvVar: "PLUGIN_SYNC,SYNC,INPUT_SYNC", EnvVars: []string{"PLUGIN_SYNC", "SYNC", "INPUT_SYNC"},
}, },
cli.DurationFlag{ &cli.DurationFlag{
Name: "timeout,t", Name: "timeout",
Usage: "connection timeout", Aliases: []string{"t"},
EnvVar: "PLUGIN_TIMEOUT,SSH_TIMEOUT,TIMEOUT,INPUT_TIMEOUT", Usage: "connection timeout",
Value: 30 * time.Second, EnvVars: []string{"PLUGIN_TIMEOUT", "SSH_TIMEOUT", "TIMEOUT", "INPUT_TIMEOUT"},
Value: 30 * time.Second,
}, },
cli.DurationFlag{ &cli.DurationFlag{
Name: "command.timeout,T", Name: "command.timeout",
Usage: "command timeout", Aliases: []string{"T"},
EnvVar: "PLUGIN_COMMAND_TIMEOUT,SSH_COMMAND_TIMEOUT,COMMAND_TIMEOUT,INPUT_COMMAND_TIMEOUT", Usage: "command timeout",
Value: 10 * time.Minute, EnvVars: []string{"PLUGIN_COMMAND_TIMEOUT", "SSH_COMMAND_TIMEOUT", "COMMAND_TIMEOUT", "INPUT_COMMAND_TIMEOUT"},
Value: 10 * time.Minute,
}, },
cli.StringSliceFlag{ &cli.StringSliceFlag{
Name: "script,s", Name: "script",
Usage: "execute commands", Aliases: []string{"s"},
EnvVar: "PLUGIN_SCRIPT,SSH_SCRIPT,SCRIPT", Usage: "execute commands",
EnvVars: []string{"PLUGIN_SCRIPT", "SSH_SCRIPT", "SCRIPT"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "script.string", Name: "script.string",
Usage: "execute single commands for github action", Usage: "execute single commands for github action",
EnvVar: "INPUT_SCRIPT", EnvVars: []string{"INPUT_SCRIPT"},
}, },
cli.BoolFlag{ &cli.BoolFlag{
Name: "script.stop", Name: "script.stop",
Usage: "stop script after first failure", Usage: "stop script after first failure",
EnvVar: "PLUGIN_SCRIPT_STOP,STOP,INPUT_SCRIPT_STOP", EnvVars: []string{"PLUGIN_SCRIPT_STOP", "STOP", "INPUT_SCRIPT_STOP"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "proxy.ssh-key", Name: "proxy.ssh-key",
Usage: "private ssh key of proxy", Usage: "private ssh key of proxy",
EnvVar: "PLUGIN_PROXY_SSH_KEY,PLUGIN_PROXY_KEY,PROXY_SSH_KEY,INPUT_PROXY_KEY", EnvVars: []string{"PLUGIN_PROXY_SSH_KEY", "PLUGIN_PROXY_KEY", "PROXY_SSH_KEY", "INPUT_PROXY_KEY"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "proxy.ssh-passphrase", Name: "proxy.ssh-passphrase",
Usage: "The purpose of the passphrase is usually to encrypt the private key.", Usage: "The purpose of the passphrase is usually to encrypt the private key.",
EnvVar: "PLUGIN_PROXY_SSH_PASSPHRASE,PLUGIN_PROXY_PASSPHRASE,PROXY_SSH_PASSPHRASE,PROXY_PASSPHRASE,INPUT_PROXY_PASSPHRASE", EnvVars: []string{"PLUGIN_PROXY_SSH_PASSPHRASE", "PLUGIN_PROXY_PASSPHRASE", "PROXY_SSH_PASSPHRASE", "PROXY_PASSPHRASE", "INPUT_PROXY_PASSPHRASE"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "proxy.key-path", Name: "proxy.key-path",
Usage: "ssh private key path of proxy", Usage: "ssh private key path of proxy",
EnvVar: "PLUGIN_PROXY_KEY_PATH,PROXY_SSH_KEY_PATH,INPUT_PROXY_KEY_PATH", EnvVars: []string{"PLUGIN_PROXY_KEY_PATH", "PROXY_SSH_KEY_PATH", "INPUT_PROXY_KEY_PATH"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "proxy.username", Name: "proxy.username",
Usage: "connect as user of proxy", Usage: "connect as user of proxy",
EnvVar: "PLUGIN_PROXY_USERNAME,PLUGIN_PROXY_USER,PROXY_SSH_USERNAME,INPUT_PROXY_USERNAME", EnvVars: []string{"PLUGIN_PROXY_USERNAME", "PLUGIN_PROXY_USER", "PROXY_SSH_USERNAME", "INPUT_PROXY_USERNAME"},
Value: "root", Value: "root",
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "proxy.password", Name: "proxy.password",
Usage: "user password of proxy", Usage: "user password of proxy",
EnvVar: "PLUGIN_PROXY_PASSWORD,PROXY_SSH_PASSWORD,INPUT_PROXY_PASSWORD", EnvVars: []string{"PLUGIN_PROXY_PASSWORD", "PROXY_SSH_PASSWORD", "INPUT_PROXY_PASSWORD"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "proxy.host", Name: "proxy.host",
Usage: "connect to host of proxy", Usage: "connect to host of proxy",
EnvVar: "PLUGIN_PROXY_HOST,PROXY_SSH_HOST,INPUT_PROXY_HOST", EnvVars: []string{"PLUGIN_PROXY_HOST", "PROXY_SSH_HOST", "INPUT_PROXY_HOST"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "proxy.port", Name: "proxy.port",
Usage: "connect to port of proxy", Usage: "connect to port of proxy",
EnvVar: "PLUGIN_PROXY_PORT,PROXY_SSH_PORT,INPUT_PROXY_PORT", EnvVars: []string{"PLUGIN_PROXY_PORT", "PROXY_SSH_PORT", "INPUT_PROXY_PORT"},
Value: "22", Value: "22",
}, },
cli.DurationFlag{ &cli.DurationFlag{
Name: "proxy.timeout", Name: "proxy.timeout",
Usage: "proxy connection timeout", Usage: "proxy connection timeout",
EnvVar: "PLUGIN_PROXY_TIMEOUT,PROXY_SSH_TIMEOUT,INPUT_PROXY_TIMEOUT", EnvVars: []string{"PLUGIN_PROXY_TIMEOUT", "PROXY_SSH_TIMEOUT", "INPUT_PROXY_TIMEOUT"},
}, },
cli.StringSliceFlag{ &cli.StringSliceFlag{
Name: "proxy.ciphers", Name: "proxy.ciphers",
Usage: "The allowed cipher algorithms. If unspecified then a sensible", Usage: "The allowed cipher algorithms. If unspecified then a sensible",
EnvVar: "PLUGIN_PROXY_CIPHERS,SSH_PROXY_CIPHERS,PROXY_CIPHERS,INPUT_PROXY_CIPHERS", EnvVars: []string{"PLUGIN_PROXY_CIPHERS", "SSH_PROXY_CIPHERS", "PROXY_CIPHERS", "INPUT_PROXY_CIPHERS"},
}, },
cli.BoolFlag{ &cli.BoolFlag{
Name: "proxy.useInsecureCipher", Name: "proxy.useInsecureCipher",
Usage: "include more ciphers with use_insecure_cipher", Usage: "include more ciphers with use_insecure_cipher",
EnvVar: "PLUGIN_PROXY_USE_INSECURE_CIPHER,SSH_PROXY_USE_INSECURE_CIPHER,PROXY_USE_INSECURE_CIPHER,INPUT_PROXY_USE_INSECURE_CIPHER", EnvVars: []string{"PLUGIN_PROXY_USE_INSECURE_CIPHER", "SSH_PROXY_USE_INSECURE_CIPHER", "PROXY_USE_INSECURE_CIPHER", "INPUT_PROXY_USE_INSECURE_CIPHER"},
}, },
cli.StringFlag{ &cli.StringFlag{
Name: "proxy.fingerprint", Name: "proxy.fingerprint",
Usage: "fingerprint SHA256 of the host public key, default is to skip verification", Usage: "fingerprint SHA256 of the host public key, default is to skip verification",
EnvVar: "PLUGIN_PROXY_FINGERPRINT,SSH_PROXY_FINGERPRINT,PROXY_FINGERPRINT,INPUT_PROXY_FINGERPRINT", EnvVars: []string{"PLUGIN_PROXY_FINGERPRINT", "SSH_PROXY_FINGERPRINT", "PROXY_FINGERPRINT", "INPUT_PROXY_FINGERPRINT"},
}, },
cli.StringSliceFlag{ &cli.StringSliceFlag{
Name: "envs", Name: "envs",
Usage: "pass environment variable to shell script", Usage: "pass environment variable to shell script",
EnvVar: "PLUGIN_ENVS,INPUT_ENVS", EnvVars: []string{"PLUGIN_ENVS", "INPUT_ENVS"},
}, },
cli.BoolFlag{ &cli.BoolFlag{
Name: "debug", Name: "debug",
Usage: "debug mode", Usage: "debug mode",
EnvVar: "PLUGIN_DEBUG,DEBUG,INPUT_DEBUG", EnvVars: []string{"PLUGIN_DEBUG", "DEBUG", "INPUT_DEBUG"},
}, },
} }