-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
52 lines (34 loc) · 927 Bytes
/
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
PACKAGES= github.com/urfave/negroni github.com/unrolled/render github.com/chromatixau/gomiddleware
all: build run
build: clean
GOPATH=`pwd -P` go build -o $(PWD)/bin/goapp goapp.go
clean:
rm -f bin/goapp
install: uninstall
GOPATH=`pwd -P` go get ${PACKAGES}
uninstall:
rm -rf src/github.com
run: build
$(PWD)/bin/goapp
# the following are used for setting up a daemon via systemd
# systemd service script not included
daemon: build restart
cleansymlink:
sudo rm -f /usr/sbin/goapp
symlink: cleansymlink
sudo ln -s $(PWD)/bin/goapp /usr/sbin/goapp
add: symlink
sudo cp -f systemd/system/goapp.service /etc/systemd/system
sudo systemctl daemon-reload
remove: disable
sudo rm -f /etc/systemd/system/goapp.service
enable: add
sudo systemctl enable goapp
start:
sudo systemctl start goapp
stop:
sudo systemctl stop goapp
restart:
sudo systemctl restart goapp
disable:
sudo systemctl disable goapp