You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.4 KiB
YAML

---
kind: pipeline
type: docker
name: linux-amd64
platform:
arch: amd64
os: linux
clone:
disable: true
steps:
- name: clone
image: alpine/git
pull: if-not-exists
extra_hosts:
- "git.awesome-for.me:host-gateway"
commands:
- git clone $DRONE_REMOTE_URL .
- name: test
image: golang:latest
pull: if-not-exists
network_mode: bridge
extra_hosts:
- "git.awesome-for.me:host-gateway"
volumes:
- name: go_cache
path: /go
commands:
- go build -o /dev/null git.awesome-for.me/liuzhiguo/drone/cmd/drone-server
- go build -o /dev/null -tags "nolimit" git.awesome-for.me/liuzhiguo/drone/cmd/drone-server
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
GOPRIVATE: git.awesome-for.me
- name: build
image: golang:latest
pull: if-not-exists
network_mode: bridge
extra_hosts:
- "git.awesome-for.me:host-gateway"
volumes:
- name: go_cache
path: /go
commands:
- sh scripts/build.sh
environment:
GOARCH: amd64
GOOS: linux
GO111MODULE: on
GOPROXY: https://goproxy.cn
GOPRIVATE: git.awesome-for.me
- name: build-image
image: docker:dind
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands:
- docker build -t "liuzhiguo/drone:beta" -f docker/Dockerfile.server.linux.amd64 .
volumes:
- name: go_cache
host:
path: /data/drone/go_cache_public
- name: docker_sock
host:
path: /var/run/docker.sock