appleboy / drone-scp

Copy files and artifacts via SSH using a binary, docker or Drone CI.
MIT License
142 stars 30 forks source link

Weird error #104

Closed Denis-Evseev closed 4 years ago

Denis-Evseev commented 4 years ago

I am trying to download one file via SSH on my server using docker The command looks:

- go get -u -v github.com/appleboy/drone-scp 
- ../go/bin/drone-scp --host $IP --port 22 --username root --password $PASSWORD --target / --source ./docker-compose.yml

It has been working well for quite a while but recently it shows an error:

github.com/appleboy/drone-scp
--
  | ../go/src/github.com/appleboy/drone-scp/main.go:25:14: cannot use []cli.Author literal (type []cli.Author) as type []*cli.Author in assignment
  | ../go/src/github.com/appleboy/drone-scp/main.go:34:22: cannot use cli.StringSliceFlag literal (type cli.StringSliceFlag) as type cli.Flag in array or slice literal:
  | cli.StringSliceFlag does not implement cli.Flag (Apply method has pointer receiver)
  | ../go/src/github.com/appleboy/drone-scp/main.go:37:10: unknown field 'EnvVar' in struct literal of type cli.StringSliceFlag
  | ../go/src/github.com/appleboy/drone-scp/main.go:39:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
  | cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
  | ../go/src/github.com/appleboy/drone-scp/main.go:43:10: unknown field 'EnvVar' in struct literal of type cli.StringFlag
  | ../go/src/github.com/appleboy/drone-scp/main.go:45:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
  | cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
  | ../go/src/github.com/appleboy/drone-scp/main.go:48:10: unknown field 'EnvVar' in struct literal of type cli.StringFlag
  | ../go/src/github.com/appleboy/drone-scp/main.go:50:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
  | cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
  | ../go/src/github.com/appleboy/drone-scp/main.go:53:10: unknown field 'EnvVar' in struct literal of type cli.StringFlag
  | ../go/src/github.com/appleboy/drone-scp/main.go:58:10: unknown field 'EnvVar' in struct literal of type cli.DurationFlag
  | ../go/src/github.com/appleboy/drone-scp/main.go:58:10: too many errors

It looks like something is broken on drone-scp side Any ideas?

appleboy commented 4 years ago

I will take it.

appleboy commented 4 years ago

@Denis-Evseev Please try the go module

$ export GO111MODULE=on
$ go get github.com/appleboy/drone-scp@master
go: finding github.com master
go: finding github.com/appleboy/drone-scp master
go: finding github.com/appleboy master
go: downloading github.com/appleboy/drone-scp v1.5.4-0.20191112021121-a2493062f754
go: extracting github.com/appleboy/drone-scp v1.5.4-0.20191112021121-a2493062f754
go: downloading github.com/urfave/cli v1.22.1
go: downloading github.com/appleboy/easyssh-proxy v1.2.0
go: downloading github.com/fatih/color v1.7.0
go: downloading github.com/joho/godotenv v1.3.0
go: downloading github.com/appleboy/com v0.0.2
go: extracting github.com/fatih/color v1.7.0
go: downloading github.com/mattn/go-colorable v0.1.4
go: downloading github.com/mattn/go-isatty v0.0.10
go: extracting github.com/appleboy/com v0.0.2
go: extracting github.com/joho/godotenv v1.3.0
go: extracting github.com/appleboy/easyssh-proxy v1.2.0
go: extracting github.com/urfave/cli v1.22.1
go: downloading golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: extracting github.com/mattn/go-colorable v0.1.4
go: extracting github.com/mattn/go-isatty v0.0.10
go: downloading golang.org/x/sys v0.0.0-20191008105621-543471e840be
go: extracting github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: extracting github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: extracting golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25
go: extracting github.com/shurcooL/sanitized_anchor_name v1.0.0
go: extracting golang.org/x/sys v0.0.0-20191008105621-543471e840be
go: finding github.com/appleboy/com v0.0.2
go: finding github.com/joho/godotenv v1.3.0
go: finding github.com/appleboy/easyssh-proxy v1.2.0
go: finding github.com/fatih/color v1.7.0
go: finding github.com/urfave/cli v1.22.1
go: finding github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: finding github.com/mattn/go-colorable v0.1.4
go: finding github.com/mattn/go-isatty v0.0.10
go: finding golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25
go: finding github.com/russross/blackfriday/v2 v2.0.1
go: finding golang.org/x/sys v0.0.0-20191008105621-543471e840be
go: finding github.com/shurcooL/sanitized_anchor_name v1.0.0
appleboy commented 4 years ago

see the commit: https://github.com/appleboy/drone-scp/commit/05eba8f8091df25e94f55b08f44a9e3bb873b35c#diff-04c6e90faac2675aa89e2176d2eec7d8

Denis-Evseev commented 4 years ago

Thank you, appleboy but still doesn't work

Added export GO111MODULE=on Before go get -u -v github.com/appleboy/drone-scp

but the issue still exists

Full log:

`Exporting environment variables Exporting TERM Exporting PAGER Exporting DISPLAY Exporting CI Exporting SEMAPHORE Exporting SEMAPHORE_PROJECT_NAME Exporting SEMAPHORE_PROJECT_ID Exporting SEMAPHORE_JOB_NAME Exporting SEMAPHORE_JOB_ID Exporting SEMAPHORE_AGENT_MACHINE_TYPE Exporting SEMAPHORE_AGENT_MACHINE_OS_IMAGE Exporting SEMAPHORE_AGENT_MACHINE_ENVIRONMENT_TYPE Exporting SEMAPHORE_ORGANIZATION_URL Exporting SEMAPHORE_ARTIFACT_TOKEN Exporting SSH_PRIVATE_KEY_PATH Exporting SEMAPHORE_CACHE_PRIVATE_KEY_PATH Exporting SEMAPHORE_CACHE_USERNAME Exporting SEMAPHORE_CACHE_URL Exporting SEMAPHORE_GIT_URL Exporting SEMAPHORE_GIT_DIR Exporting SEMAPHORE_GIT_SHA Exporting SEMAPHORE_GIT_REPO_SLUG Exporting SEMAPHORE_GIT_REF Exporting SEMAPHORE_GIT_COMMIT_RANGE Exporting SEMAPHORE_GIT_REF_TYPE Exporting SEMAPHORE_GIT_BRANCH Exporting PASSWORD Exporting IP Exporting SEMAPHORE_WORKFLOW_ID Exporting SEMAPHORE_WORKFLOW_NUMBER Exporting SEMAPHORE_PIPELINE_ARTEFACT_ID Exporting SEMAPHORE_PIPELINE_ID Exporting SEMAPHORE_PIPELINE_0_ARTEFACT_ID Injecting Files Injecting /home/semaphore/.ssh/semaphore_cache_key with file mode 0600 Injecting .ssh/id_rsa with file mode 0600 git clone https://github.com/semaphoreci/toolbox.git ~/.toolbox Cloning into '/home/semaphore/.toolbox'... remote: Enumerating objects: 38, done. remote: Counting objects: 2% (1/38) remote: Counting objects: 5% (2/38) remote: Counting objects: 7% (3/38) remote: Counting objects: 10% (4/38) remote: Counting objects: 13% (5/38) remote: Counting objects: 15% (6/38) remote: Counting objects: 18% (7/38) remote: Counting objects: 21% (8/38) remote: Counting objects: 23% (9/38) remote: Counting objects: 26% (10/38) remote: Counting objects: 28% (11/38) remote: Counting objects: 31% (12/38) remote: Counting objects: 34% (13/38) remote: Counting objects: 36% (14/38) remote: Counting objects: 39% (15/38) remote: Counting objects: 42% (16/38) remote: Counting objects: 44% (17/38) remote: Counting objects: 47% (18/38) remote: Counting objects: 50% (19/38) remote: Counting objects: 52% (20/38) remote: Counting objects: 55% (21/38) remote: Counting objects: 57% (22/38) remote: Counting objects: 60% (23/38) remote: Counting objects: 63% (24/38) remote: Counting objects: 65% (25/38) remote: Counting objects: 68% (26/38) remote: Counting objects: 71% (27/38) remote: Counting objects: 73% (28/38) remote: Counting objects: 76% (29/38) remote: Counting objects: 78% (30/38) remote: Counting objects: 81% (31/38) remote: Counting objects: 84% (32/38) remote: Counting objects: 86% (33/38) remote: Counting objects: 89% (34/38) remote: Counting objects: 92% (35/38) remote: Counting objects: 94% (36/38) remote: Counting objects: 97% (37/38) remote: Counting objects: 100% (38/38) remote: Counting objects: 100% (38/38), done. remote: Compressing objects: 3% (1/31) remote: Compressing objects: 6% (2/31) remote: Compressing objects: 9% (3/31) remote: Compressing objects: 12% (4/31) remote: Compressing objects: 16% (5/31) remote: Compressing objects: 19% (6/31) remote: Compressing objects: 22% (7/31) remote: Compressing objects: 25% (8/31) remote: Compressing objects: 29% (9/31) remote: Compressing objects: 32% (10/31) remote: Compressing objects: 35% (11/31) remote: Compressing objects: 38% (12/31) remote: Compressing objects: 41% (13/31) remote: Compressing objects: 45% (14/31) remote: Compressing objects: 48% (15/31) remote: Compressing objects: 51% (16/31) remote: Compressing objects: 54% (17/31) remote: Compressing objects: 58% (18/31) remote: Compressing objects: 61% (19/31) remote: Compressing objects: 64% (20/31) remote: Compressing objects: 67% (21/31) remote: Compressing objects: 70% (22/31) remote: Compressing objects: 74% (23/31) remote: Compressing objects: 77% (24/31) remote: Compressing objects: 80% (25/31) remote: Compressing objects: 83% (26/31) remote: Compressing objects: 87% (27/31) remote: Compressing objects: 90% (28/31) remote: Compressing objects: 93% (29/31) remote: Compressing objects: 96% (30/31) remote: Compressing objects: 100% (31/31) remote: Compressing objects: 100% (31/31), done. Receiving objects: 0% (1/1120)

Receiving objects: 1% (12/1120)

Receiving objects: 2% (23/1120)

Receiving objects: 3% (34/1120)

Receiving objects: 4% (45/1120)

Receiving objects: 5% (56/1120)

Receiving objects: 6% (68/1120)

Receiving objects: 7% (79/1120)

Receiving objects: 8% (90/1120)

Receiving objects: 9% (101/1120)

Receiving objects: 10% (112/1120)

Receiving objects: 11% (124/1120)

Receiving objects: 12% (135/1120)

Receiving objects: 13% (146/1120)

Receiving objects: 14% (157/1120)

Receiving objects: 15% (168/1120)

Receiving objects: 16% (180/1120)

Receiving objects: 17% (191/1120)

Receiving objects: 18% (202/1120)

Receiving objects: 19% (213/1120)

Receiving objects: 20% (224/1120)

Receiving objects: 21% (236/1120)

Receiving objects: 22% (247/1120)

Receiving objects: 23% (258/1120)

Receiving objects: 24% (269/1120)

Receiving objects: 25% (280/1120)

Receiving objects: 26% (292/1120)

Receiving objects: 27% (303/1120)

Receiving objects: 28% (314/1120)

Receiving objects: 29% (325/1120)

Receiving objects: 30% (336/1120)

Receiving objects: 31% (348/1120)

Receiving objects: 32% (359/1120)

Receiving objects: 33% (370/1120)

Receiving objects: 34% (381/1120)

Receiving objects: 35% (392/1120)

Receiving objects: 36% (404/1120)

Receiving objects: 37% (415/1120)

Receiving objects: 38% (426/1120)

Receiving objects: 39% (437/1120)

Receiving objects: 40% (448/1120)

Receiving objects: 41% (460/1120)

Receiving objects: 42% (471/1120)

Receiving objects: 43% (482/1120)

Receiving objects: 44% (493/1120)

Receiving objects: 45% (504/1120)

Receiving objects: 46% (516/1120)

Receiving objects: 47% (527/1120)

Receiving objects: 48% (538/1120)

Receiving objects: 49% (549/1120)

Receiving objects: 50% (560/1120)

Receiving objects: 51% (572/1120)

Receiving objects: 52% (583/1120)

Receiving objects: 53% (594/1120)

Receiving objects: 54% (605/1120)

Receiving objects: 55% (616/1120)

Receiving objects: 56% (628/1120)

Receiving objects: 57% (639/1120)

Receiving objects: 58% (650/1120)

Receiving objects: 59% (661/1120)

Receiving objects: 60% (672/1120)

Receiving objects: 61% (684/1120)

Receiving objects: 62% (695/1120)

Receiving objects: 63% (706/1120)

Receiving objects: 64% (717/1120)

Receiving objects: 65% (728/1120)

Receiving objects: 66% (740/1120)

Receiving objects: 67% (751/1120)

Receiving objects: 68% (762/1120)

Receiving objects: 69% (773/1120)

Receiving objects: 70% (784/1120)

Receiving objects: 71% (796/1120)

Receiving objects: 72% (807/1120)

Receiving objects: 73% (818/1120)

Receiving objects: 74% (829/1120)

Receiving objects: 75% (840/1120)

Receiving objects: 76% (852/1120)

Receiving objects: 77% (863/1120)

Receiving objects: 78% (874/1120)

Receiving objects: 79% (885/1120)

Receiving objects: 80% (896/1120)

Receiving objects: 81% (908/1120)

Receiving objects: 82% (919/1120)

Receiving objects: 83% (930/1120)

Receiving objects: 84% (941/1120)

Receiving objects: 85% (952/1120)

Receiving objects: 86% (964/1120)

Receiving objects: 87% (975/1120)

Receiving objects: 88% (986/1120)

Receiving objects: 89% (997/1120)

Receiving objects: 90% (1008/1120)

Receiving objects: 91% (1020/1120)

Receiving objects: 92% (1031/1120)

Receiving objects: 93% (1042/1120)

Receiving objects: 94% (1053/1120)

Receiving objects: 95% (1064/1120)

Receiving objects: 96% (1076/1120)

Receiving objects: 97% (1087/1120) remote: Total 1120 (delta 16), reused 13 (delta 5), pack-reused 1082

Receiving objects: 98% (1098/1120)

Receiving objects: 99% (1109/1120)

Receiving objects: 100% (1120/1120)

Receiving objects: 100% (1120/1120), 240.54 KiB | 889.00 KiB/s, done.

Resolving deltas: 0% (0/621)

Resolving deltas: 1% (7/621)

Resolving deltas: 8% (50/621)

Resolving deltas: 10% (67/621)

Resolving deltas: 11% (71/621)

Resolving deltas: 15% (94/621)

Resolving deltas: 16% (103/621)

Resolving deltas: 19% (119/621)

Resolving deltas: 20% (125/621)

Resolving deltas: 24% (150/621)

Resolving deltas: 26% (164/621)

Resolving deltas: 27% (168/621)

Resolving deltas: 35% (218/621)

Resolving deltas: 36% (224/621)

Resolving deltas: 39% (248/621)

Resolving deltas: 40% (251/621)

Resolving deltas: 42% (261/621)

Resolving deltas: 43% (272/621)

Resolving deltas: 47% (298/621)

Resolving deltas: 48% (299/621)

Resolving deltas: 73% (459/621)

Resolving deltas: 74% (465/621)

Resolving deltas: 75% (466/621)

Resolving deltas: 76% (472/621)

Resolving deltas: 77% (482/621)

Resolving deltas: 82% (513/621)

Resolving deltas: 83% (521/621)

Resolving deltas: 88% (552/621)

Resolving deltas: 89% (555/621)

Resolving deltas: 90% (564/621)

Resolving deltas: 92% (575/621)

Resolving deltas: 93% (579/621)

Resolving deltas: 94% (584/621)

Resolving deltas: 100% (621/621)

Resolving deltas: 100% (621/621), done. bash ~/.toolbox/install-toolbox source ~/.toolbox/toolbox echo 'source ~/.toolbox/toolbox' >> ~/.bash_profile if [ -f /etc/init.d/xvfb ]; then /etc/init.d/xvfb start; fi Starting virtual X frame buffer: Xvfb. eval ssh-agent Agent pid 1918 ssh-keyscan -p 29920 -H 94.130.158.146 >> /home/semaphore/.ssh/known_hosts

94.130.158.146:29920 SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.13

94.130.158.146:29920 SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.13

94.130.158.146:29920 SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.13

ssh-add /home/semaphore/.ssh/semaphore_cache_key Identity added: /home/semaphore/.ssh/semaphore_cache_key (/home/semaphore/.ssh/semaphore_cache_key) echo 'yes' > /tmp/sempahore-user-commands-have-started checkout Performing shallow clone with depth: 50 HEAD is now at 8267aaa 2nd attempt export GO111MODULE=on go get -u -v github.com/appleboy/drone-scp github.com/appleboy/drone-scp (download) created GOPATH=/home/semaphore/go; see 'go help gopath' github.com/appleboy/com (download) github.com/appleboy/easyssh-proxy (download) Fetching https://golang.org/x/crypto/ssh?go-get=1 Parsing meta tags from https://golang.org/x/crypto/ssh?go-get=1 (status code 200) get "golang.org/x/crypto/ssh": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ssh?go-get=1 get "golang.org/x/crypto/ssh": verifying non-authoritative meta tag Fetching https://golang.org/x/crypto?go-get=1 Parsing meta tags from https://golang.org/x/crypto?go-get=1 (status code 200) golang.org/x/crypto (download) Fetching https://golang.org/x/crypto/chacha20?go-get=1 Parsing meta tags from https://golang.org/x/crypto/chacha20?go-get=1 (status code 200) get "golang.org/x/crypto/chacha20": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/chacha20?go-get=1 get "golang.org/x/crypto/chacha20": verifying non-authoritative meta tag Fetching https://golang.org/x/crypto/internal/subtle?go-get=1 Parsing meta tags from https://golang.org/x/crypto/internal/subtle?go-get=1 (status code 200) get "golang.org/x/crypto/internal/subtle": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/internal/subtle?go-get=1 get "golang.org/x/crypto/internal/subtle": verifying non-authoritative meta tag Fetching https://golang.org/x/crypto/curve25519?go-get=1 Parsing meta tags from https://golang.org/x/crypto/curve25519?go-get=1 (status code 200) get "golang.org/x/crypto/curve25519": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/curve25519?go-get=1 get "golang.org/x/crypto/curve25519": verifying non-authoritative meta tag Fetching https://golang.org/x/crypto/ed25519?go-get=1 Parsing meta tags from https://golang.org/x/crypto/ed25519?go-get=1 (status code 200) get "golang.org/x/crypto/ed25519": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ed25519?go-get=1 get "golang.org/x/crypto/ed25519": verifying non-authoritative meta tag Fetching https://golang.org/x/crypto/ed25519/internal/edwards25519?go-get=1 Parsing meta tags from https://golang.org/x/crypto/ed25519/internal/edwards25519?go-get=1 (status code 200) get "golang.org/x/crypto/ed25519/internal/edwards25519": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ed25519/internal/edwards25519?go-get=1 get "golang.org/x/crypto/ed25519/internal/edwards25519": verifying non-authoritative meta tag Fetching https://golang.org/x/crypto/poly1305?go-get=1 Parsing meta tags from https://golang.org/x/crypto/poly1305?go-get=1 (status code 200) get "golang.org/x/crypto/poly1305": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/poly1305?go-get=1 get "golang.org/x/crypto/poly1305": verifying non-authoritative meta tag Fetching https://golang.org/x/crypto/ssh/agent?go-get=1 Parsing meta tags from https://golang.org/x/crypto/ssh/agent?go-get=1 (status code 200) get "golang.org/x/crypto/ssh/agent": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/ssh/agent?go-get=1 get "golang.org/x/crypto/ssh/agent": verifying non-authoritative meta tag github.com/fatih/color (download) github.com/joho/godotenv (download) github.com/urfave/cli (download) github.com/cpuguy83/go-md2man (download) github.com/appleboy/com/random golang.org/x/crypto/internal/subtle golang.org/x/crypto/curve25519 golang.org/x/crypto/chacha20 golang.org/x/crypto/ed25519/internal/edwards25519 golang.org/x/crypto/poly1305 github.com/fatih/color/vendor/github.com/mattn/go-isatty github.com/fatih/color/vendor/github.com/mattn/go-colorable github.com/fatih/color golang.org/x/crypto/ed25519 github.com/joho/godotenv golang.org/x/crypto/ssh github.com/joho/godotenv/autoload github.com/cpuguy83/go-md2man/vendor/github.com/shurcooL/sanitized_anchor_name github.com/cpuguy83/go-md2man/vendor/github.com/russross/blackfriday/v2 github.com/cpuguy83/go-md2man/md2man github.com/urfave/cli golang.org/x/crypto/ssh/agent github.com/appleboy/easyssh-proxy github.com/appleboy/drone-scp

github.com/appleboy/drone-scp

../go/src/github.com/appleboy/drone-scp/main.go:25:14: cannot use []cli.Author literal (type []cli.Author) as type []*cli.Author in assignment ../go/src/github.com/appleboy/drone-scp/main.go:34:22: cannot use cli.StringSliceFlag literal (type cli.StringSliceFlag) as type cli.Flag in array or slice literal: cli.StringSliceFlag does not implement cli.Flag (Apply method has pointer receiver) ../go/src/github.com/appleboy/drone-scp/main.go:37:10: unknown field 'EnvVar' in struct literal of type cli.StringSliceFlag ../go/src/github.com/appleboy/drone-scp/main.go:39:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal: cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver) ../go/src/github.com/appleboy/drone-scp/main.go:43:10: unknown field 'EnvVar' in struct literal of type cli.StringFlag ../go/src/github.com/appleboy/drone-scp/main.go:45:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal: cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver) ../go/src/github.com/appleboy/drone-scp/main.go:48:10: unknown field 'EnvVar' in struct literal of type cli.StringFlag ../go/src/github.com/appleboy/drone-scp/main.go:50:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal: cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver) ../go/src/github.com/appleboy/drone-scp/main.go:53:10: unknown field 'EnvVar' in struct literal of type cli.StringFlag ../go/src/github.com/appleboy/drone-scp/main.go:58:10: unknown field 'EnvVar' in struct literal of type cli.DurationFlag ../go/src/github.com/appleboy/drone-scp/main.go:58:10: too many errors export SEMAPHORE_JOB_RESULT=failed`

Denis-Evseev commented 4 years ago

@appleboy Please help - can't release a new version of my project You can find the export GO111MODULE=on in the log to prove that I tried it

appleboy commented 4 years ago

@Denis-Evseev I can't reproduce in Docker.

You can try the following steps in Docker.

docker run -ti golang /bin/bash
export GO111MODULE=on
go get -u -v github.com/appleboy/drone-scp
Denis-Evseev commented 4 years ago

@appleboy - tried, no luck :( It seems to me docker doesn't make a big difference here and it looks like something is wrong in main.go based on the error:

../go/src/github.com/appleboy/drone-scp/main.go:25:14: cannot use []cli.Author literal (type []cli.Author) as type []*cli.Author in assignment
--
  | ../go/src/github.com/appleboy/drone-scp/main.go:34:22: cannot use cli.StringSliceFlag literal (type cli.StringSliceFlag) as type cli.Flag in array or slice literal:
  | cli.StringSliceFlag does not implement cli.Flag (Apply method has pointer receiver)
  | ../go/src/github.com/appleboy/drone-scp/main.go:37:10: unknown field 'EnvVar' in struct literal of type cli.StringSliceFlag
  | ../go/src/github.com/appleboy/drone-scp/main.go:39:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
  | cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
  | ../go/src/github.com/appleboy/drone-scp/main.go:43:10: unknown field 'EnvVar' in struct literal of type cli.StringFlag
  | ../go/src/github.com/appleboy/drone-scp/main.go:45:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
  | cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
  | ../go/src/github.com/appleboy/drone-scp/main.go:48:10: unknown field 'EnvVar' in struct literal of type cli.StringFlag
  | ../go/src/github.com/appleboy/drone-scp/main.go:50:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
  | cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
  | ../go/src/github.com/appleboy/drone-scp/main.go:53:10: unknown field 'EnvVar' in struct literal of type cli.StringFlag
  | ../go/src/github.com/appleboy/drone-scp/main.go:58:10: unknown field 'EnvVar' in struct literal of type cli.DurationFlag
  | ../go/src/github.com/appleboy/drone-scp/main.go:58:10: too many errors

Can you run your test without 'master' (I can't use 'master' in my environment) The issue appeared 5-6 days ago and my commit published 7 days worked well via drone-scp (now they also crash)

Can it be an issue if a version of GO or smth?

Many thanks

appleboy commented 4 years ago

maybe you can download the binary file here.

Denis-Evseev commented 4 years ago

@appleboy - can't use it in my system. Also tried to download v1.5.3 - the same error

Any thoughts?

appleboy commented 4 years ago

@Denis-Evseev

# please use go version 1.13
git clone https://github.com/appleboy/drone-scp.git
export GO111MODULE=on
go mod vendor
go build -o main main.go
Denis-Evseev commented 4 years ago

@appleboy I managed to fix it! Semaphore CI uses GO 1.11. Specified version 1.13 and added export GO111MODULE=on It solved the issue!

Thank you for all your help, it is probably the most frustrating when you can't deploy a project because of inconsistent versions or new releases...

appleboy commented 4 years ago

@Denis-Evseev Yes, agree with your point.