2014-03-02 03:46:10 +00:00
|
|
|
SHA := $(shell git rev-parse --short HEAD)
|
|
|
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
2014-02-07 10:10:01 +00:00
|
|
|
|
|
|
|
all: embed build
|
|
|
|
|
|
|
|
deps:
|
2014-02-18 03:47:12 +00:00
|
|
|
[ -d $$GOPATH/src/code.google.com/p/go ] || hg clone -u default https://code.google.com/p/go $$GOPATH/src/code.google.com/p/go
|
|
|
|
[ -d $$GOPATH/src/github.com/dotcloud/docker ] || git clone git://github.com/dotcloud/docker $$GOPATH/src/github.com/dotcloud/docker
|
2014-02-07 10:10:01 +00:00
|
|
|
go get code.google.com/p/go.crypto/bcrypt
|
|
|
|
go get code.google.com/p/go.crypto/ssh
|
|
|
|
go get code.google.com/p/go.net/websocket
|
|
|
|
go get code.google.com/p/go.text/unicode/norm
|
2014-02-18 03:36:00 +00:00
|
|
|
#go get code.google.com/p/go/src/pkg/archive/tar
|
2014-02-07 10:10:01 +00:00
|
|
|
go get launchpad.net/goyaml
|
|
|
|
go get github.com/andybons/hipchat
|
|
|
|
go get github.com/bmizerany/pat
|
|
|
|
go get github.com/dchest/authcookie
|
|
|
|
go get github.com/dchest/passwordreset
|
|
|
|
go get github.com/dchest/uniuri
|
2014-02-22 00:10:04 +00:00
|
|
|
go get github.com/fluffle/goirc
|
2014-02-18 03:36:00 +00:00
|
|
|
#go get github.com/dotcloud/docker/archive
|
|
|
|
#go get github.com/dotcloud/docker/utils
|
|
|
|
#go get github.com/dotcloud/docker/pkg/term
|
2014-02-07 10:10:01 +00:00
|
|
|
go get github.com/drone/go-github/github
|
|
|
|
go get github.com/drone/go-bitbucket/bitbucket
|
|
|
|
go get github.com/GeertJohan/go.rice
|
|
|
|
go get github.com/GeertJohan/go.rice/rice
|
2014-03-08 05:19:28 +00:00
|
|
|
go get github.com/go-sql-driver/mysql
|
2014-02-07 10:10:01 +00:00
|
|
|
go get github.com/mattn/go-sqlite3
|
|
|
|
go get github.com/russross/meddler
|
|
|
|
|
2014-03-02 05:43:20 +00:00
|
|
|
embed: js
|
2014-02-07 10:10:01 +00:00
|
|
|
cd cmd/droned && rice embed
|
|
|
|
cd pkg/template && rice embed
|
|
|
|
|
2014-03-02 05:43:20 +00:00
|
|
|
js:
|
|
|
|
cd cmd/droned/assets && find js -name "*.js" ! -name '.*' ! -name "main.js" -exec cat {} \; > js/main.js
|
|
|
|
|
2014-02-07 10:10:01 +00:00
|
|
|
build:
|
|
|
|
cd cmd/drone && go build -o ../../bin/drone
|
2014-03-02 03:46:10 +00:00
|
|
|
cd cmd/droned && go build -ldflags "-X main.version $(SHA)" -o ../../bin/droned
|
2014-02-07 10:10:01 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
go test -v github.com/drone/drone/pkg/build
|
|
|
|
go test -v github.com/drone/drone/pkg/build/buildfile
|
|
|
|
go test -v github.com/drone/drone/pkg/build/docker
|
|
|
|
go test -v github.com/drone/drone/pkg/build/dockerfile
|
|
|
|
go test -v github.com/drone/drone/pkg/build/proxy
|
|
|
|
go test -v github.com/drone/drone/pkg/build/repo
|
|
|
|
go test -v github.com/drone/drone/pkg/build/script
|
|
|
|
go test -v github.com/drone/drone/pkg/channel
|
|
|
|
go test -v github.com/drone/drone/pkg/database
|
|
|
|
go test -v github.com/drone/drone/pkg/database/encrypt
|
2014-02-15 20:47:30 +00:00
|
|
|
go test -v github.com/drone/drone/pkg/database/migrate
|
2014-02-07 10:10:01 +00:00
|
|
|
go test -v github.com/drone/drone/pkg/database/testing
|
|
|
|
go test -v github.com/drone/drone/pkg/mail
|
|
|
|
go test -v github.com/drone/drone/pkg/model
|
2014-02-23 13:19:00 +00:00
|
|
|
go test -v github.com/drone/drone/pkg/plugin/deploy
|
2014-02-07 10:10:01 +00:00
|
|
|
go test -v github.com/drone/drone/pkg/queue
|
|
|
|
|
|
|
|
install:
|
|
|
|
cp deb/drone/etc/init/drone.conf /etc/init/drone.conf
|
2014-02-08 23:32:24 +00:00
|
|
|
test -f /etc/default/drone || cp deb/drone/etc/default/drone /etc/default/drone
|
2014-02-07 10:10:01 +00:00
|
|
|
cd bin && install -t /usr/local/bin drone
|
|
|
|
cd bin && install -t /usr/local/bin droned
|
|
|
|
mkdir -p /var/lib/drone
|
|
|
|
|
|
|
|
clean:
|
|
|
|
cd cmd/droned && rice clean
|
|
|
|
cd pkg/template && rice clean
|
|
|
|
rm -rf cmd/drone/drone
|
|
|
|
rm -rf cmd/droned/droned
|
|
|
|
rm -rf cmd/droned/drone.sqlite
|
|
|
|
rm -rf bin/drone
|
|
|
|
rm -rf bin/droned
|
|
|
|
rm -rf deb/drone.deb
|
|
|
|
rm -rf usr/local/bin/drone
|
|
|
|
rm -rf usr/local/bin/droned
|
|
|
|
rm -rf drone.sqlite
|
2014-02-09 13:36:45 +00:00
|
|
|
rm -rf /tmp/drone.sqlite
|
2014-02-07 10:10:01 +00:00
|
|
|
|
|
|
|
# creates a debian package for drone
|
|
|
|
# to install `sudo dpkg -i drone.deb`
|
|
|
|
dpkg:
|
|
|
|
mkdir -p deb/drone/usr/local/bin
|
|
|
|
mkdir -p deb/drone/var/lib/drone
|
2014-03-03 06:35:01 +00:00
|
|
|
mkdir -p deb/drone/var/cache/drone
|
2014-02-07 10:10:01 +00:00
|
|
|
cp bin/drone deb/drone/usr/local/bin
|
|
|
|
cp bin/droned deb/drone/usr/local/bin
|
2014-02-26 21:23:25 +00:00
|
|
|
-dpkg-deb --build deb/drone
|
2014-02-07 10:10:01 +00:00
|
|
|
|
|
|
|
run:
|
2014-02-16 01:57:34 +00:00
|
|
|
bin/droned --port=":8080" --datasource="drone.sqlite"
|