|
|
@ -9,18 +9,18 @@ volumes: |
|
|
|
path: /usr/local/path/gopath |
|
|
|
|
|
|
|
steps: |
|
|
|
# - name: golang-build |
|
|
|
# image: golang |
|
|
|
# volumes: |
|
|
|
# - name: gopath |
|
|
|
# path: /go |
|
|
|
# commands: |
|
|
|
# - export GOPROXY=https://goproxy.cn |
|
|
|
# - go mod init test-drone |
|
|
|
# - go mod tidy |
|
|
|
# - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o test-drone |
|
|
|
# when: |
|
|
|
# target: [ "" ] |
|
|
|
- name: golang-build |
|
|
|
image: golang |
|
|
|
volumes: |
|
|
|
- name: gopath |
|
|
|
path: /go |
|
|
|
commands: |
|
|
|
- export GOPROXY=https://goproxy.cn |
|
|
|
- go mod init test-drone |
|
|
|
- go mod tidy |
|
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o test-drone |
|
|
|
when: |
|
|
|
target: [ "test","pre" ] |
|
|
|
|
|
|
|
# - name: docker-push |
|
|
|
# image: plugins/docker |
|
|
|