mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-21 05:36:18 +00:00
Update Makefile and .drone.yml
Use better versioning when build and make use godep to link drone with vendored dependencies.
This commit is contained in:
parent
aac0a8830f
commit
d61e1d7df7
2 changed files with 20 additions and 11 deletions
|
@ -5,7 +5,7 @@ env:
|
||||||
- PATH=$PWD/Godeps/_workspace/bin:/var/cache/drone/bin:$PATH
|
- PATH=$PWD/Godeps/_workspace/bin:/var/cache/drone/bin:$PATH
|
||||||
script:
|
script:
|
||||||
- sudo apt-get -y install libsqlite3-dev sqlite3 1> /dev/null 2> /dev/null
|
- sudo apt-get -y install libsqlite3-dev sqlite3 1> /dev/null 2> /dev/null
|
||||||
- make
|
- make build-dist
|
||||||
- make test
|
- make test
|
||||||
- make dpkg
|
- make dpkg
|
||||||
notify:
|
notify:
|
||||||
|
|
29
Makefile
29
Makefile
|
@ -1,3 +1,5 @@
|
||||||
|
SELFPKG := github.com/drone/drone
|
||||||
|
VERSION := 0.2
|
||||||
SHA := $(shell git rev-parse --short HEAD)
|
SHA := $(shell git rev-parse --short HEAD)
|
||||||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
PKGS := \
|
PKGS := \
|
||||||
|
@ -22,10 +24,25 @@ PKGS := $(addprefix github.com/drone/drone/pkg/,$(PKGS))
|
||||||
|
|
||||||
all: embed build
|
all: embed build
|
||||||
|
|
||||||
|
build:
|
||||||
|
go build -o bin/drone -ldflags "-X main.version $(VERSION)dev-$(SHA)" $(SELFPKG)/cmd/drone
|
||||||
|
go build -o bin/droned -ldflags "-X main.version $(VERSION)dev-$(SHA)" $(SELFPKG)/cmd/droned
|
||||||
|
|
||||||
|
build-dist: godep
|
||||||
|
godep go build -o bin/drone -ldflags "-X main.version $(VERSION)-$(SHA)" $(SELFPKG)/cmd/drone
|
||||||
|
godep go build -o bin/droned -ldflags "-X main.version $(VERSION)-$(SHA)" $(SELFPKG)/cmd/droned
|
||||||
|
|
||||||
|
bump-deps: deps vendor
|
||||||
|
|
||||||
|
deps:
|
||||||
|
go get -u -t -v ./...
|
||||||
|
|
||||||
vendor: godep
|
vendor: godep
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
godep save ./...
|
godep save ./...
|
||||||
|
|
||||||
|
|
||||||
|
# Embed static assets
|
||||||
embed: js rice
|
embed: js rice
|
||||||
cd cmd/droned && rice embed
|
cd cmd/droned && rice embed
|
||||||
cd pkg/template && rice embed
|
cd pkg/template && rice embed
|
||||||
|
@ -33,14 +50,10 @@ embed: js rice
|
||||||
js:
|
js:
|
||||||
cd cmd/droned/assets && find js -name "*.js" ! -name '.*' ! -name "main.js" -exec cat {} \; > js/main.js
|
cd cmd/droned/assets && find js -name "*.js" ! -name '.*' ! -name "main.js" -exec cat {} \; > js/main.js
|
||||||
|
|
||||||
build:
|
|
||||||
cd cmd/drone && go build -ldflags "-X main.version $(SHA)" -o ../../bin/drone
|
|
||||||
cd cmd/droned && go build -ldflags "-X main.version $(SHA)" -o ../../bin/droned
|
|
||||||
|
|
||||||
test: $(PKGS)
|
test: $(PKGS)
|
||||||
|
|
||||||
$(PKGS):
|
$(PKGS): godep
|
||||||
go test -v $@
|
godep go test -v $@
|
||||||
|
|
||||||
install:
|
install:
|
||||||
cp deb/drone/etc/init/drone.conf /etc/init/drone.conf
|
cp deb/drone/etc/init/drone.conf /etc/init/drone.conf
|
||||||
|
@ -76,10 +89,6 @@ dpkg:
|
||||||
run:
|
run:
|
||||||
bin/droned --port=":8080" --datasource="drone.sqlite"
|
bin/droned --port=":8080" --datasource="drone.sqlite"
|
||||||
|
|
||||||
go-gitlab-client:
|
|
||||||
rm -rf $$GOPATH/src/github.com/plouc/go-gitlab-client
|
|
||||||
git clone -b raw-request https://github.com/fudanchii/go-gitlab-client $$GOPATH/src/github.com/plouc/go-gitlab-client
|
|
||||||
|
|
||||||
godep:
|
godep:
|
||||||
go get github.com/tools/godep
|
go get github.com/tools/godep
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue