woodpecker/Makefile

49 lines
1.5 KiB
Makefile
Raw Normal View History

2015-10-07 20:15:38 +00:00
.PHONY: vendor docs
2015-05-15 21:55:26 +00:00
2015-09-30 01:21:17 +00:00
PACKAGES = $(shell go list ./... | grep -v /vendor/)
2014-02-07 10:10:01 +00:00
2015-09-30 01:21:17 +00:00
all: gen build
deps:
2015-10-06 21:50:41 +00:00
go get -u golang.org/x/tools/cmd/cover
go get -u github.com/eknkc/amber/...
go get -u github.com/eknkc/amber
go get -u github.com/jteeuwen/go-bindata/...
go get -u github.com/elazarl/go-bindata-assetfs/...
go get -u github.com/dchest/jsmin
go get -u github.com/franela/goblin
2015-09-30 01:21:17 +00:00
2015-10-06 17:19:43 +00:00
gen: gen_static gen_template gen_migrations
gen_static:
go generate github.com/drone/drone/static
gen_template:
go generate github.com/drone/drone/template
gen_migrations:
go generate github.com/drone/drone/store/datastore/ddl
2015-09-02 23:52:59 +00:00
2016-04-20 01:37:53 +00:00
build: build_static
2015-09-30 01:21:17 +00:00
build_static:
2016-04-20 01:37:53 +00:00
cd drone && go build --ldflags '-extldflags "-static" -X github.com/drone/drone/version.VersionDev=$(CI_BUILD_NUMBER)' -o drone
2015-09-30 01:21:17 +00:00
test:
go test -cover $(PACKAGES)
# docker run --publish=3306:3306 -e MYSQL_DATABASE=test -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:5.6.27
test_mysql:
2015-11-11 22:52:29 +00:00
DATABASE_DRIVER="mysql" DATABASE_CONFIG="root@tcp(127.0.0.1:3306)/test?parseTime=true" go test github.com/drone/drone/store/datastore
# docker run --publish=5432:5432 postgres:9.4.5
test_postgres:
2015-11-11 22:52:29 +00:00
DATABASE_DRIVER="postgres" DATABASE_CONFIG="host=127.0.0.1 user=postgres dbname=postgres sslmode=disable" go test github.com/drone/drone/store/datastore
2015-09-30 01:21:17 +00:00
deb:
mkdir -p contrib/debian/drone/usr/local/bin
mkdir -p contrib/debian/drone/var/lib/drone
mkdir -p contrib/debian/drone/var/cache/drone
cp drone contrib/debian/drone/usr/local/bin
-dpkg-deb --build contrib/debian/drone