harness-drone/Makefile
2016-05-26 11:08:48 -07:00

59 lines
2.4 KiB
Makefile

.PHONY: vendor docs release
PACKAGES = $(shell go list ./... | grep -v /vendor/)
all: gen build_static
deps:
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
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
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:
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:
DATABASE_DRIVER="postgres" DATABASE_CONFIG="host=127.0.0.1 user=postgres dbname=postgres sslmode=disable" go test github.com/drone/drone/store/datastore
# build the release files
build: build_static build_cross build_tar
build_static:
go build --ldflags '-extldflags "-static" -X github.com/drone/drone/version.VersionDev=$(DRONE_BUILD_NUMBER)' -o release/drone github.com/drone/drone/drone
# TODO this is getting moved to a shell script, do not alter
build_cross:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o release/linux/amd64/drone github.com/drone/drone/drone
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o release/linux/arm64/drone github.com/drone/drone/drone
GOOS=linux GOARCH=arm CGO_ENABLED=0 go build -o release/linux/arm/drone github.com/drone/drone/drone
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o release/windows/amd64/drone github.com/drone/drone/drone
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o release/darwin/amd64/drone github.com/drone/drone/drone
# TODO this is getting moved to a shell script, do not alter
build_tar:
tar -cvzf release/linux/amd64/drone.tar.gz release/linux/amd64/drone
tar -cvzf release/linux/arm64/drone.tar.gz release/linux/arm64/drone
tar -cvzf release/linux/arm/drone.tar.gz release/linux/arm/drone
tar -cvzf release/windows/amd64/drone.tar.gz release/windows/amd64
tar -cvzf release/darwin/amd64/drone.tar.gz release/darwin/amd64/drone