2015-05-15 21:55:26 +00:00
|
|
|
.PHONY: dist
|
|
|
|
|
2014-03-02 03:46:10 +00:00
|
|
|
SHA := $(shell git rev-parse --short HEAD)
|
2015-04-07 08:20:55 +00:00
|
|
|
VERSION := 0.4.0-alpha
|
2014-02-07 10:10:01 +00:00
|
|
|
|
2015-04-25 23:16:56 +00:00
|
|
|
all: concat bindata build
|
2014-04-10 17:44:26 +00:00
|
|
|
|
|
|
|
deps:
|
2015-05-17 21:25:04 +00:00
|
|
|
go get github.com/jteeuwen/go-bindata/...
|
2014-04-10 17:44:26 +00:00
|
|
|
|
2014-06-04 21:25:38 +00:00
|
|
|
test:
|
2015-05-22 18:37:40 +00:00
|
|
|
go vet github.com/drone/drone/pkg/...
|
|
|
|
go vet github.com/drone/drone/cmd/...
|
|
|
|
go test -cover -short github.com/drone/drone/pkg/...
|
2014-04-10 17:44:26 +00:00
|
|
|
|
2015-08-24 18:25:01 +00:00
|
|
|
# Execute the database test suite against mysql 5.5
|
|
|
|
#
|
|
|
|
# You can launch a mysql container locally for testing:
|
|
|
|
# docker run -rm -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_DATABASE=test -p 3306:3306 mysql:5.5
|
|
|
|
test_mysql:
|
|
|
|
mysql -P 3306 --protocol=tcp -u root -e 'create database if not exists test;'
|
|
|
|
TEST_DRIVER="mysql" TEST_DATASOURCE="root@tcp(127.0.0.1:3306)/test" go test -short github.com/drone/drone/pkg/store/builtin
|
|
|
|
mysql -P 3306 --protocol=tcp -u root -e 'drop database test;'
|
|
|
|
|
2014-07-14 02:41:08 +00:00
|
|
|
build:
|
2015-08-20 18:09:12 +00:00
|
|
|
go build -o bin/drone -ldflags "-X main.revision=$(SHA) -X main.version=$(VERSION).$(SHA)" github.com/drone/drone/cmd/drone-server
|
|
|
|
go build -o bin/drone-agent -ldflags "-X main.revision=$(SHA) -X main.version=$(VERSION).$(SHA)" github.com/drone/drone/cmd/drone-agent
|
2015-05-18 17:05:58 +00:00
|
|
|
|
2015-05-24 01:52:04 +00:00
|
|
|
run:
|
|
|
|
bin/drone-server --debug
|
2014-06-21 21:22:38 +00:00
|
|
|
|
2014-06-04 21:25:38 +00:00
|
|
|
clean:
|
2014-07-14 02:41:08 +00:00
|
|
|
find . -name "*.out" -delete
|
2015-05-22 18:37:40 +00:00
|
|
|
find . -name "*_bindata.go" -delete
|
|
|
|
rm -f bin/drone*
|
2015-04-25 23:16:56 +00:00
|
|
|
|
|
|
|
concat:
|
2015-05-22 18:37:40 +00:00
|
|
|
cat cmd/drone-server/static/scripts/drone.js \
|
2015-05-17 21:25:04 +00:00
|
|
|
cmd/drone-server/static/scripts/services/*.js \
|
|
|
|
cmd/drone-server/static/scripts/filters/*.js \
|
|
|
|
cmd/drone-server/static/scripts/controllers/*.js \
|
|
|
|
cmd/drone-server/static/scripts/term.js > cmd/drone-server/static/scripts/drone.min.js
|
|
|
|
|
2015-05-18 02:25:53 +00:00
|
|
|
# installs the drone binaries into bin
|
|
|
|
install:
|
|
|
|
install -t /usr/local/bin bin/drone
|
|
|
|
install -t /usr/local/bin bin/drone-agent
|
|
|
|
|
2015-05-17 21:25:04 +00:00
|
|
|
# embeds all the static files directly
|
|
|
|
# into the drone binary file
|
|
|
|
bindata:
|
|
|
|
$$GOPATH/bin/go-bindata -o="cmd/drone-server/drone_bindata.go" cmd/drone-server/static/...
|
2015-04-28 21:39:48 +00:00
|
|
|
|
2015-04-25 23:16:56 +00:00
|
|
|
bindata_debug:
|
2015-05-17 21:25:04 +00:00
|
|
|
$$GOPATH/bin/go-bindata --debug -o="cmd/drone-server/drone_bindata.go" cmd/drone-server/static/...
|
2015-05-15 21:55:26 +00:00
|
|
|
|
2015-08-19 19:38:08 +00:00
|
|
|
docker:
|
|
|
|
docker build --file=cmd/drone-build/Dockerfile.alpine --rm=true -t drone/drone-build .
|
|
|
|
|
2015-05-15 21:55:26 +00:00
|
|
|
# creates a debian package for drone
|
|
|
|
# to install `sudo dpkg -i drone.deb`
|
|
|
|
dist:
|
|
|
|
mkdir -p dist/drone/usr/local/bin
|
|
|
|
mkdir -p dist/drone/var/lib/drone
|
|
|
|
mkdir -p dist/drone/var/cache/drone
|
|
|
|
cp bin/drone dist/drone/usr/local/bin
|
|
|
|
-dpkg-deb --build dist/drone
|