blob: 59922b6af35f984bda7495df4e263bea5496500f (
plain)
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
|
.PHONY: build
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d)
all: build
./gowebd test
build: goimports
GO111MODULE=off go build \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
verbose:
GO111MODULE=off go build -v -x \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
install:
GO111MODULE=off go install \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
prod: build
make stop
cp gowebd /usr/bin/gowebd
# allow the binary to open ports below 1024
setcap 'cap_net_bind_service=+ep' /usr/bin/gowebd
make start
make log
log:
@#systemctl status gowebd.service
journalctl -f -xeu gowebd.service
enable:
systemctl enable gowebd.service
restart:
systemctl stop gowebd.service
systemctl start gowebd.service
start:
systemctl start gowebd.service
stop:
systemctl stop gowebd.service
run: build
./gowebd --port 2233 --repomap resources/repomap --hostname test.wit.com
# setcap 'cap_net_bind_service=+ep' gowebd # allow the binary to open ports below 1024
goimports:
reset
goimports -w *.go
clean:
rm -f go.*
rm -f go.wit.com
rm -f gowebd
go-mod-clean purge
# makes a .deb package
debian:
rm ~/incoming/gowebd*.deb
go-deb --no-gui --keep-files --repo go.wit.com/apps/gowebd
squash-the-last-3-commits-together:
git rebase -i HEAD~3
git fsck
git prune
|