aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile7
-rw-r--r--nonsense-time.service1
2 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b6980df..c8ee401 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
BIN:= nonsense-time
SERVICE:= nonsense-time.service
+STATIC := ./static/
+TEMPLATES := ./templates/
.PHONY: all test clean build install info
@@ -8,7 +10,12 @@ all: build
build: $(BIN)
install: $(BIN)
+ rm -rf /usr/local/share/nonsense-time
cp $(BIN) /usr/bin
+ cp $(SERVICE) /etc/systemd/system/
+ mkdir /usr/local/share/nonsense-time
+ cp -r $(STATIC) /usr/local/share/nonsense-time
+ cp -r $(TEMPLATES) /usr/local/share/nonsense-time
test:
go test ./...
diff --git a/nonsense-time.service b/nonsense-time.service
index 673f88a..9fe0227 100644
--- a/nonsense-time.service
+++ b/nonsense-time.service
@@ -3,6 +3,7 @@ Description=Nonsense Time backend
After=nginx.service
[Service]
+WorkingDirectory=/usr/local/share/nonsense-time
ExecStart=/usr/bin/nonsense-time -b 127.0.0.1 -p 1500
Type=simple
Restart=on-failure