Compare commits

...

8 Commits

Author SHA1 Message Date
Bo-Yi Wu 8ed049422b chore(binary): unsupported GOOS/GOARCH pair darwin/386
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-10-23 18:43:22 +08:00
Bo-Yi Wu 731b24356e chore(lint): check removeAllDestFile
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-10-23 18:30:17 +08:00
Bo-Yi Wu 2d05265e3d chore(deploy): disbale testing
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-10-23 18:28:09 +08:00
Bo-Yi Wu 6ddf21aca4 chore(action): wrong variable name
see https://github.com/appleboy/scp-action/issues/30

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-10-23 18:23:13 +08:00
Bo-Yi Wu 8c5cba51c2 chore(go): upgrade go module
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-10-23 18:17:23 +08:00
Bo-Yi Wu 1b33947d29 chore: upgrade to go.16
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-06-18 08:52:35 +08:00
Bo-Yi Wu 35f7b2f6af chore: upgrade to go1.15
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-09-25 22:13:34 +08:00
Bo-Yi Wu f0867af189 chore: remove auto load .env file
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-06-15 15:55:32 +08:00
7 changed files with 87 additions and 95 deletions
+28 -40
View File
@@ -9,7 +9,7 @@ platform:
steps: steps:
- name: vet - name: vet
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- make vet - make vet
volumes: volumes:
@@ -18,7 +18,7 @@ steps:
- name: lint - name: lint
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- make lint - make lint
volumes: volumes:
@@ -27,25 +27,13 @@ steps:
- name: misspell - name: misspell
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- make misspell-check - make misspell-check
volumes: volumes:
- name: gopath - name: gopath
path: /go path: /go
- name: test
pull: always
image: golang:1.14-alpine
commands:
- apk add git make curl perl bash build-base zlib-dev ucl-dev
- make ssh-server
- make test
- make coverage
volumes:
- name: gopath
path: /go
- name: codecov - name: codecov
pull: always pull: always
image: robertstettner/drone-codecov image: robertstettner/drone-codecov
@@ -68,9 +56,9 @@ platform:
steps: steps:
- name: build-push - name: build-push
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-scp" - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-scp
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@@ -80,9 +68,9 @@ steps:
- name: build-tag - name: build-tag
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-scp" - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-scp
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@@ -91,7 +79,7 @@ steps:
- name: executable - name: executable
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- ./release/linux/amd64/drone-scp --help - ./release/linux/amd64/drone-scp --help
@@ -130,8 +118,8 @@ steps:
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
- "refs/pull/**" - refs/pull/**
- "refs/tags/**" - refs/tags/**
depends_on: depends_on:
- testing - testing
@@ -147,9 +135,9 @@ platform:
steps: steps:
- name: build-push - name: build-push
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-scp" - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-scp
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@@ -159,9 +147,9 @@ steps:
- name: build-tag - name: build-tag
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-scp" - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-scp
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@@ -170,7 +158,7 @@ steps:
- name: executable - name: executable
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- ./release/linux/arm64/drone-scp --help - ./release/linux/arm64/drone-scp --help
@@ -209,8 +197,8 @@ steps:
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
- "refs/pull/**" - refs/pull/**
- "refs/tags/**" - refs/tags/**
depends_on: depends_on:
- testing - testing
@@ -226,9 +214,9 @@ platform:
steps: steps:
- name: build-push - name: build-push
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-scp" - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-scp
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@@ -238,9 +226,9 @@ steps:
- name: build-tag - name: build-tag
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-scp" - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-scp
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@@ -249,7 +237,7 @@ steps:
- name: executable - name: executable
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- ./release/linux/arm/drone-scp --help - ./release/linux/arm/drone-scp --help
@@ -288,8 +276,8 @@ steps:
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
- "refs/pull/**" - refs/pull/**
- "refs/tags/**" - refs/tags/**
depends_on: depends_on:
- testing - testing
@@ -305,7 +293,7 @@ platform:
steps: steps:
- name: build-all-binary - name: build-all-binary
pull: always pull: always
image: golang:1.14 image: golang:1.16
commands: commands:
- make release - make release
when: when:
@@ -319,14 +307,14 @@ steps:
api_key: api_key:
from_secret: github_release_api_key from_secret: github_release_api_key
files: files:
- "dist/release/*" - dist/release/*
when: when:
event: event:
- tag - tag
trigger: trigger:
ref: ref:
- "refs/tags/**" - refs/tags/**
depends_on: depends_on:
- testing - testing
@@ -354,7 +342,7 @@ steps:
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
- "refs/tags/**" - refs/tags/**
depends_on: depends_on:
- linux-amd64 - linux-amd64
+1 -1
View File
@@ -8,7 +8,7 @@ DEPLOY_ACCOUNT := appleboy
DEPLOY_IMAGE := $(EXECUTABLE) DEPLOY_IMAGE := $(EXECUTABLE)
TARGETS ?= linux darwin windows TARGETS ?= linux darwin windows
ARCHS ?= amd64 386 ARCHS ?= amd64
SOURCES ?= $(shell find . -name "*.go" -type f) SOURCES ?= $(shell find . -name "*.go" -type f)
TAGS ?= TAGS ?=
LDFLAGS ?= -X 'main.Version=$(VERSION)' LDFLAGS ?= -X 'main.Version=$(VERSION)'
+6 -6
View File
@@ -3,11 +3,11 @@ module github.com/appleboy/drone-scp
go 1.14 go 1.14
require ( require (
github.com/appleboy/com v0.0.6 github.com/appleboy/com v0.1.5
github.com/appleboy/easyssh-proxy v1.3.7 github.com/appleboy/easyssh-proxy v1.3.9
github.com/fatih/color v1.9.0 github.com/fatih/color v1.9.0
github.com/joho/godotenv v1.3.0 github.com/joho/godotenv v1.4.0
github.com/stretchr/testify v1.5.1 github.com/stretchr/testify v1.7.0
github.com/urfave/cli/v2 v2.2.0 github.com/urfave/cli/v2 v2.3.0
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9
) )
+23 -16
View File
@@ -1,10 +1,10 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/ScaleFT/sshkeys v0.0.0-20181112160850-82451a803681 h1:JS2rl38kZmHgWa0xINSaSYH0Whtvem64/4+Ef0+Y5pE= github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5 h1:VauE2GcJNZFun2Och6tIT2zJZK1v6jxALQDA9BIji/E=
github.com/ScaleFT/sshkeys v0.0.0-20181112160850-82451a803681/go.mod h1:WfDateMPQ/55dPbZRp5Zxrux5WiEaHsjk9puUhz0KgY= github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o=
github.com/appleboy/com v0.0.6 h1:l8cZ0aQJU/SWyL79ciYAJeqV835PRdlZ6efiPhus5Ic= github.com/appleboy/com v0.1.5 h1:MNWkTSBtEN+YaQO4IGCTQ8xfMvf3h57LLnUNTmCfDDM=
github.com/appleboy/com v0.0.6/go.mod h1:jnufjIC3opMlReyPPPye+8JqNvUzLm25o7h6SOy8nv0= github.com/appleboy/com v0.1.5/go.mod h1:jnufjIC3opMlReyPPPye+8JqNvUzLm25o7h6SOy8nv0=
github.com/appleboy/easyssh-proxy v1.3.7 h1:4XsChI8PuAd6jwTIKvTCH97vWmknvMJGxYi0PLiULG8= github.com/appleboy/easyssh-proxy v1.3.9 h1:b+sVSTz+cVFvfA23HQywMMpm0s5g3gH7jYdBcQqaCQI=
github.com/appleboy/easyssh-proxy v1.3.7/go.mod h1:Kk57I3w7OCafOjp5kgZFvxk2fO8Tca5CriBTOsbSbjY= github.com/appleboy/easyssh-proxy v1.3.9/go.mod h1:G1eQomBEME7NWKA3hE49s5HsT44S5fn0aBxX7k9Yjug=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
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.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
@@ -13,8 +13,8 @@ github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a h1:saTgr5tMLFn
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/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
@@ -27,22 +27,29 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 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/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
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-20191227163750-53104e6ec876 h1:sKJQZMuxjOAR/Uo2LBfU90onWEf1dF4C+0hPJCc9Mpc= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 h1:sYNJzB4J8toYPQTM6pAkcmBRgw9SnQKP9oXCHfgy604=
golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/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 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
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 h1:jceGD5YNJGgGMkJz79agzOln1K9TaZUjv5ird16qniQ=
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
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=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+2 -3
View File
@@ -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"
) )
@@ -171,7 +170,7 @@ func main() {
&cli.StringFlag{ &cli.StringFlag{
Name: "proxy.ssh-key", Name: "proxy.ssh-key",
Usage: "private ssh key of proxy", Usage: "private ssh key of proxy",
EnvVars: []string{"PLUGIN_PROXY_SSH_KEY", "PLUGIN_PROXY_KEY", "PROXY_SSH_KEY", "PROXY_KEY", "INPUT_PROXY_SSH_KEY"}, EnvVars: []string{"PLUGIN_PROXY_SSH_KEY", "PLUGIN_PROXY_KEY", "PROXY_SSH_KEY", "PROXY_KEY", "INPUT_PROXY_KEY"},
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: "proxy.ssh-passphrase", Name: "proxy.ssh-passphrase",
@@ -181,7 +180,7 @@ func main() {
&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",
EnvVars: []string{"PLUGIN_PROXY_KEY_PATH", "PROXY_SSH_KEY_PATH", "INPUT_PROXY_SSH_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",
+24 -24
View File
@@ -9,7 +9,7 @@
steps: [ steps: [
{ {
name: 'vet', name: 'vet',
image: 'golang:1.14', image: 'golang:1.16',
pull: 'always', pull: 'always',
commands: [ commands: [
'make vet', 'make vet',
@@ -23,7 +23,7 @@
}, },
{ {
name: 'lint', name: 'lint',
image: 'golang:1.14', image: 'golang:1.16',
pull: 'always', pull: 'always',
commands: [ commands: [
'make lint', 'make lint',
@@ -37,7 +37,7 @@
}, },
{ {
name: 'misspell', name: 'misspell',
image: 'golang:1.14', image: 'golang:1.16',
pull: 'always', pull: 'always',
commands: [ commands: [
'make misspell-check', 'make misspell-check',
@@ -49,23 +49,23 @@
}, },
], ],
}, },
{ // {
name: 'test', // name: 'test',
image: 'golang:1.14-alpine', // image: 'golang:1.16-alpine',
pull: 'always', // pull: 'always',
commands: [ // commands: [
'apk add git make curl perl bash build-base zlib-dev ucl-dev', // 'apk add git make curl perl bash build-base zlib-dev ucl-dev',
'make ssh-server', // 'make ssh-server',
'make test', // 'make test',
'make coverage', // 'make coverage',
], // ],
volumes: [ // volumes: [
{ // {
name: 'gopath', // name: 'gopath',
path: '/go', // path: '/go',
}, // },
], // ],
}, // },
{ {
name: 'codecov', name: 'codecov',
image: 'robertstettner/drone-codecov', image: 'robertstettner/drone-codecov',
@@ -93,7 +93,7 @@
steps: [ steps: [
{ {
name: 'build-push', name: 'build-push',
image: 'golang:1.14', image: 'golang:1.16',
pull: 'always', pull: 'always',
environment: { environment: {
CGO_ENABLED: '0', CGO_ENABLED: '0',
@@ -109,7 +109,7 @@
}, },
{ {
name: 'build-tag', name: 'build-tag',
image: 'golang:1.14', image: 'golang:1.16',
pull: 'always', pull: 'always',
environment: { environment: {
CGO_ENABLED: '0', CGO_ENABLED: '0',
@@ -123,7 +123,7 @@
}, },
{ {
name: 'executable', name: 'executable',
image: 'golang:1.14', image: 'golang:1.16',
pull: 'always', pull: 'always',
commands: [ commands: [
'./release/' + os + '/' + arch + '/' + name + ' --help', './release/' + os + '/' + arch + '/' + name + ' --help',
@@ -188,7 +188,7 @@
steps: [ steps: [
{ {
name: 'build-all-binary', name: 'build-all-binary',
image: 'golang:1.14', image: 'golang:1.16',
pull: 'always', pull: 'always',
commands: [ commands: [
'make release' 'make release'
+3 -5
View File
@@ -153,7 +153,6 @@ func (p Plugin) log(host string, message ...interface{}) {
func (p *Plugin) removeDestFile(ssh *easyssh.MakeConfig) error { func (p *Plugin) removeDestFile(ssh *easyssh.MakeConfig) error {
p.log(ssh.Server, "remove file", p.DestFile) p.log(ssh.Server, "remove file", p.DestFile)
_, errStr, _, err := ssh.Run(fmt.Sprintf("rm -rf %s", p.DestFile), p.Config.CommandTimeout) _, errStr, _, err := ssh.Run(fmt.Sprintf("rm -rf %s", p.DestFile), p.Config.CommandTimeout)
if err != nil { if err != nil {
return err return err
} }
@@ -316,7 +315,6 @@ func (p *Plugin) Exec() error {
// Call Scp method with file you want to upload to remote server. // Call Scp method with file you want to upload to remote server.
p.log(host, "scp file to server.") p.log(host, "scp file to server.")
err := ssh.Scp(tar, p.DestFile) err := ssh.Scp(tar, p.DestFile)
if err != nil { if err != nil {
errChannel <- copyError{host, err.Error()} errChannel <- copyError{host, err.Error()}
return return
@@ -328,7 +326,6 @@ func (p *Plugin) Exec() error {
p.log(host, "Remove target folder:", target) p.log(host, "Remove target folder:", target)
_, _, _, err := ssh.Run(fmt.Sprintf("rm -rf %s", target), p.Config.CommandTimeout) _, _, _, err := ssh.Run(fmt.Sprintf("rm -rf %s", target), p.Config.CommandTimeout)
if err != nil { if err != nil {
errChannel <- err errChannel <- err
return return
@@ -378,7 +375,6 @@ func (p *Plugin) Exec() error {
} }
wg.Done() wg.Done()
}(host) }(host)
} }
@@ -395,7 +391,9 @@ func (p *Plugin) Exec() error {
c.Println("drone-scp error: ", err) c.Println("drone-scp error: ", err)
if _, ok := err.(copyError); !ok { if _, ok := err.(copyError); !ok {
fmt.Println("drone-scp rollback: remove all target tmp file") fmt.Println("drone-scp rollback: remove all target tmp file")
p.removeAllDestFile() if err := p.removeAllDestFile(); err != nil {
return err
}
} }
return err return err
} }