forked from harness/harness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
99 lines (88 loc) · 2.82 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
SHA := $(shell git rev-parse --short HEAD)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
PKGS := \
build \
build/buildfile \
build/docker \
build/dockerfile \
build/proxy \
build/repo \
build/script \
channel \
database \
database/encrypt \
database/migrate \
database/testing \
mail \
model \
plugin/deploy \
queue
PKGS := $(addprefix github.com/drone/drone/pkg/,$(PKGS))
.PHONY := test $(PKGS)
all: embed build
deps:
[ -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
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
#go get code.google.com/p/go/src/pkg/archive/tar
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
go get github.com/fluffle/goirc
#go get github.com/dotcloud/docker/archive
#go get github.com/dotcloud/docker/utils
#go get github.com/dotcloud/docker/pkg/term
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
go get github.com/go-sql-driver/mysql
go get github.com/mattn/go-sqlite3
go get github.com/russross/meddler
embed: js
cd cmd/droned && rice embed
cd pkg/template && rice embed
js:
cd cmd/droned/assets && find js -name "*.js" ! -name '.*' ! -name "main.js" -exec cat {} \; > js/main.js
build:
cd cmd/drone && go build -ldflags "-X main.version $(SHA)" -o ../../bin/drone
cd cmd/droned && go build -ldflags "-X main.version $(SHA)" -o ../../bin/droned
test: $(PKGS)
$(PKGS):
go test -v $@
install:
cp deb/drone/etc/init/drone.conf /etc/init/drone.conf
test -f /etc/default/drone || cp deb/drone/etc/default/drone /etc/default/drone
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
rm -rf /tmp/drone.sqlite
# 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
mkdir -p deb/drone/var/cache/drone
cp bin/drone deb/drone/usr/local/bin
cp bin/droned deb/drone/usr/local/bin
-dpkg-deb --build deb/drone
run:
bin/droned --port=":8080" --datasource="drone.sqlite"