我的.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
由无人机建造得到错误,如下图所示。
"/bin/sh: 1: base64: 未找到">
这个问题
解决了!在 "environment" 节点的 .drone.yml 文件中 - PATH=$GOPATH/bin:/usr/local/bin:$PATH 销毁了 PATH 环境。所以删除 - PATH=$PATH:/go 行代码就可以了。
https://github.com/drone/drone/issues/2296