Hello,
i’m pretty new with drone, and i already am conflicted to problems, due to the architecture of my projects.
as some projects need to be rebuilt after one other project has been modified (a base image for example), I wanted to use github.com/drone-plugins/drone-downstream to launch as steps the builds.
(I have to admit i’ve not seen a better option for gitlab projects, one that could search in all repositories the ones needing a rebuild like http://plugins.drone.io/gboddin/drone-github-search-downstream/ )
the thing is i’m stuck on the way to use drone-downstream, as the basic example:
kind: pipeline
name: default
steps:
- name: trigger
image: plugins/downstream
settings:
server: https://drone.example.com
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
fork: true
repositories:
- octocat/Hello-World
- octocat/Spoon-Knife
works perfectly. But. when fitting it to my arcitecture, with a few groups to not have all repositories in the same folder , the plugin can’t find the repository
example with the following:
- name: trigger
image: plugins/downstream
command:
- "drone deploy test"
settings:
fork: true
server: [my_drone_server_url]
token:
from_secret: downstream_token
repositories:
- dicew4r/services/private/repository_name
the parser panics and outputs
time="2019-06-18T13:07:05Z" level=fatal msg="Error: unable to parse repository name dicew4r/services/private/repository_name.\n"
in the source code, the following function
func parseRepoBranch(repo string) (string, string, string) {
var (
owner string
name string
branch string
)
parts := strings.Split(repo, "@")
if len(parts) == 2 {
branch = parts[1]
repo = parts[0]
}
parts = strings.Split(repo, "/")
if len(parts) == 2 {
owner = parts[0]
name = parts[1]
}
return owner, name, branch
}
is clearly badly splitting the data, or not handling it at all, but i can’t even recompile the drone-downstream binary the way the documentation do, because of various build errors:
the following build outputs is bellow:
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on
go build -v -a -tags netgo -o release/linux/amd64/drone-downstream
runtime/internal/sys
internal/race
runtime/internal/atomic
errors
sync/atomic
internal/cpu
unicode/utf8
runtime
internal/testlog
unicode
math
encoding
unicode/utf16
math/bits
container/list
crypto/subtle
crypto/internal/cipherhw
vendor/golang_org/x/crypto/cryptobyte/asn1
internal/nettrace
vendor/golang_org/x/crypto/poly1305
vendor/golang_org/x/crypto/curve25519
strconv
crypto/rc4
sync
io
math/rand
reflect
syscall
internal/singleflight
bytes
strings
bufio
hash
crypto/cipher
hash/crc32
time
crypto/aes
internal/syscall/unix
crypto
crypto/sha512
crypto/hmac
crypto/md5
crypto/sha1
internal/poll
crypto/sha256
encoding/binary
sort
os
vendor/golang_org/x/text/transform
path
encoding/base64
crypto/des
vendor/golang_org/x/crypto/chacha20poly1305/internal/chacha20
vendor/golang_org/x/crypto/chacha20poly1305
regexp/syntax
encoding/pem
fmt
path/filepath
text/tabwriter
io/ioutil
regexp
context
compress/flate
encoding/json
math/big
compress/gzip
encoding/hex
net
net/url
vendor/golang_org/x/net/http2/hpack
log
vendor/golang_org/x/text/unicode/norm
vendor/golang_org/x/text/unicode/bidi
crypto/rand
crypto/elliptic
encoding/asn1
crypto/rsa
crypto/dsa
crypto/ecdsa
crypto/x509/pkix
vendor/golang_org/x/crypto/cryptobyte
vendor/golang_org/x/text/secure/bidirule
mime
vendor/golang_org/x/net/idna
mime/quotedprintable
crypto/x509
vendor/golang_org/x/net/proxy
net/textproto
net/http/internal
os/exec
vendor/golang_org/x/net/lex/httplex
mime/multipart
golang.org/x/sys/unix
flag
github.com/joho/godotenv
crypto/tls
text/template/parse
text/template
github.com/sirupsen/logrus
net/http/httptrace
github.com/urfave/cli
net/http
golang.org/x/net/context/ctxhttp
github.com/drone/drone-go/drone
golang.org/x/oauth2/internal
golang.org/x/oauth2
gitlab.com/wiserskills/tools/drone-downstream
# gitlab.com/wiserskills/tools/drone-downstream
./plugin.go:116:38: not enough arguments in call to client.BuildList
have (string, string)
want (string, string, drone.ListOptions)
./plugin.go:122:12: b.Branch undefined (type *drone.Build has no field or method Branch)
./plugin.go:122:45: undefined: drone.StatusSuccess
./plugin.go:145:22: client.Deploy undefined (type drone.Client has no field or method Deploy)
./plugin.go:170:51: undefined: drone.StatusSuccess
./plugin.go:171:37: not enough arguments in call to client.BuildList
have (string, string)
want (string, string, drone.ListOptions)
./plugin.go:178:11: b.Branch undefined (type *drone.Build has no field or method Branch)
./plugin.go:178:44: undefined: drone.StatusSuccess
./plugin.go:191:22: client.BuildFork undefined (type drone.Client has no field or method BuildFork)
./plugin.go:203:22: client.BuildStart undefined (type drone.Client has no field or method BuildStart)
./plugin.go:203:22: too many errors
many thanks if someone can help me with this