mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-26 21:44:44 +00:00
ci: fix build (#231)
This commit is contained in:
parent
bfc4aa8059
commit
b52ef5f270
2 changed files with 20 additions and 1 deletions
|
@ -48,7 +48,7 @@ pipeline:
|
||||||
commands:
|
commands:
|
||||||
- go get github.com/woodpecker-ci/togo
|
- go get github.com/woodpecker-ci/togo
|
||||||
- (cd web/; go generate ./...)
|
- (cd web/; go generate ./...)
|
||||||
- ./.drone.sh
|
- make release
|
||||||
when:
|
when:
|
||||||
event: [push, tag]
|
event: [push, tag]
|
||||||
|
|
||||||
|
|
19
Makefile
19
Makefile
|
@ -2,6 +2,17 @@ DOCKER_RUN_GO_VERSION=1.16
|
||||||
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./.git/*")
|
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./.git/*")
|
||||||
GO_PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
|
GO_PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
|
||||||
|
|
||||||
|
VERSION ?= ${DRONE_TAG}
|
||||||
|
ifeq ($(VERSION),)
|
||||||
|
VERSION := $(shell echo ${DRONE_COMMIT_SHA} | head -c 8)
|
||||||
|
endif
|
||||||
|
|
||||||
|
LDFLAGS ?= -extldflags "-static"
|
||||||
|
ifneq ($(VERSION),)
|
||||||
|
LDFLAGS := ${LDFLAGS} -X github.com/woodpecker-ci/woodpecker/version.Version=${VERSION}
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
DOCKER_RUN?=
|
DOCKER_RUN?=
|
||||||
_with-docker:
|
_with-docker:
|
||||||
$(eval DOCKER_RUN=docker run --rm -v $(shell pwd):/go/src/ -v $(shell pwd)/build:/build -w /go/src golang:$(DOCKER_RUN_GO_VERSION))
|
$(eval DOCKER_RUN=docker run --rm -v $(shell pwd):/go/src/ -v $(shell pwd)/build:/build -w /go/src golang:$(DOCKER_RUN_GO_VERSION))
|
||||||
|
@ -62,6 +73,14 @@ build-frontend:
|
||||||
|
|
||||||
build: build-agent build-server
|
build: build-agent build-server
|
||||||
|
|
||||||
|
release-agent:
|
||||||
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '${LDFLAGS}' -o release/drone-agent github.com/woodpecker-ci/woodpecker/cmd/drone-agent
|
||||||
|
|
||||||
|
release-server:
|
||||||
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '${LDFLAGS}' -o release/drone-server github.com/woodpecker-ci/woodpecker/cmd/drone-server
|
||||||
|
|
||||||
|
release: release-agent release-server
|
||||||
|
|
||||||
install:
|
install:
|
||||||
go install github.com/woodpecker-ci/woodpecker/cmd/drone-agent
|
go install github.com/woodpecker-ci/woodpecker/cmd/drone-agent
|
||||||
go install github.com/woodpecker-ci/woodpecker/cmd/drone-server
|
go install github.com/woodpecker-ci/woodpecker/cmd/drone-server
|
||||||
|
|
Loading…
Reference in a new issue