我的.drone.yml文件定义如下
branches:
include: [ master, dev ]
exclude: [ develop, feature/* ]
clone:
git:
image: plugins/git
depth: 50
workspace:
base: /go
path: src/xx.com/metis
pipeline:
build:
when:
branch: master
image: golang:alpine
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- CGO=0
- GOOS=linux
- GOARCH=amd64
- PATH=$PATH:/go
- GOPATH=/go
commands:
- go env
- go build -v -o metis
由无人机建造得到如下图片的错误。
答案 0 :(得分:0)
这个问题解决了!在.drone.yml文件中的“环境”节点 - PATH = $ GOPATH / bin:/ usr / local / bin:$ PATH销毁了PATH环境。所以删除 - PATH = $ PATH:/ go行代码就可以了。