2015-10-07 22:15:38 +02:00
|
|
|
.PHONY: vendor docs
|
2015-05-15 23:55:26 +02:00
|
|
|
|
2015-09-30 03:21:17 +02:00
|
|
|
PACKAGES = $(shell go list ./... | grep -v /vendor/)
|
2014-02-07 13:10:01 +03:00
|
|
|
|
2015-09-30 03:21:17 +02:00
|
|
|
all: gen build
|
|
|
|
|
|
|
|
deps:
|
2015-10-06 23:50:41 +02:00
|
|
|
go get -u golang.org/x/tools/cmd/cover
|
|
|
|
go get -u golang.org/x/tools/cmd/vet
|
|
|
|
go get -u github.com/kr/vexp
|
|
|
|
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-10-07 00:50:15 +02:00
|
|
|
go get -u github.com/go-swagger/go-swagger/...
|
2015-10-06 23:50:41 +02:00
|
|
|
go get -u github.com/PuerkitoBio/goquery
|
|
|
|
go get -u github.com/russross/blackfriday
|
2015-09-30 03:21:17 +02:00
|
|
|
|
2015-10-06 19:19:43 +02:00
|
|
|
gen: gen_static gen_template gen_migrations
|
|
|
|
|
|
|
|
gen_static:
|
2015-10-06 23:41:55 +02:00
|
|
|
mkdir -p static/docs_gen/api static/docs_gen/build
|
2015-10-07 22:15:38 +02:00
|
|
|
mkdir -p static/docs_gen/api static/docs_gen/plugin
|
|
|
|
mkdir -p static/docs_gen/api static/docs_gen/setup
|
2015-10-26 00:18:16 +02:00
|
|
|
mkdir -p static/docs_gen/api static/docs_gen/cli
|
2015-10-06 19:19:43 +02:00
|
|
|
go generate github.com/drone/drone/static
|
|
|
|
|
|
|
|
gen_template:
|
|
|
|
go generate github.com/drone/drone/template
|
|
|
|
|
|
|
|
gen_migrations:
|
2015-10-22 01:39:43 +02:00
|
|
|
go generate github.com/drone/drone/store/migration
|
2015-09-03 01:52:59 +02:00
|
|
|
|
|
|
|
build:
|
2015-09-30 23:00:48 +02:00
|
|
|
go build
|
2015-09-30 03:21:17 +02:00
|
|
|
|
|
|
|
build_static:
|
2015-10-14 21:48:46 +02:00
|
|
|
go build --ldflags '-extldflags "-static" -X main.version=$(CI_BUILD_NUMBER)' -o drone_static
|
2015-09-30 03:21:17 +02:00
|
|
|
|
|
|
|
test:
|
|
|
|
go test -cover $(PACKAGES)
|
|
|
|
|
2015-10-20 09:08:09 +02:00
|
|
|
# docker run --publish=3306:3306 -e MYSQL_DATABASE=test -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:5.6.27
|
|
|
|
test_mysql:
|
|
|
|
DATABASE_DRIVER="mysql" DATABASE_CONFIG="root@tcp(127.0.0.1:3306)/test?parseTime=true" go test github.com/drone/drone/model
|
|
|
|
|
|
|
|
# docker run --publish=5432:5432 postgres:9.4.5
|
|
|
|
test_postgres:
|
|
|
|
DATABASE_DRIVER="postgres" DATABASE_CONFIG="host=127.0.0.1 user=postgres dbname=postgres sslmode=disable" go test github.com/drone/drone/model
|
|
|
|
|
2015-09-30 03:21:17 +02: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
|
|
|
|
|
|
|
|
vendor:
|
|
|
|
vexp
|
2015-10-07 22:15:38 +02:00
|
|
|
|
|
|
|
docs:
|
|
|
|
mkdir -p /drone/tmp/docs
|
2015-10-07 23:41:30 +02:00
|
|
|
mkdir -p /drone/tmp/static
|
2015-10-26 19:41:07 +02:00
|
|
|
cp -a static/docs_gen/* /drone/tmp/
|
2015-10-07 23:41:30 +02:00
|
|
|
cp -a static/styles_gen /drone/tmp/static/
|
|
|
|
cp -a static/images /drone/tmp/static/
|