blob: 49e8b5d28a5304681583901931b2d983d5b09931 (
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
|
ifndef STATUS_DB_DRIVER
export STATUS_DB_DRIVER:=sqlite3
endif
ifndef STATUS_DB_CREDENTIALS
export STATUS_DB_CREDENTIALS:=../db/status.db
endif
ifndef STATUS_DB_IMPORT_DRIVER
export STATUS_DB_IMPORT_DRIVER:=github.com/mattn/go-sqlite3
endif
ifndef STATUS_REDIS_SERVER
export STATUS_REDIS_SERVER:=127.0.0.1
endif
ifndef STATUS_REDIS_PORT
export STATUS_REDIS_PORT:=6379
endif
ifndef STATUS_HTTP_IP
export STATUS_HTTP_IP:=127.0.0.1
endif
ifndef STATUS_HTTP_PORT
export STATUS_HTTP_PORT:=8080
endif
IMPORT_FILE:=import.go
all: kill build run
clean: kill
@echo "Removing import file..."
@rm $(IMPORT_FILE) || true
@echo "Removing sqlite3 database..."
@rm $(STATUS_DB_CREDENTIALS) || true
@echo "Removing binary..."
@rm statuspage
@echo "Done."
build:
@echo "package main" > $(IMPORT_FILE)
@echo "import (_ \"$(STATUS_DB_IMPORT_DRIVER)\")" >> $(IMPORT_FILE)
go build -o statuspage
run:
./statuspage &
kill:
@echo "Killing running instances..."
@pkill statuspage || true
|