aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-01-22 14:57:20 +0700
committerShulhan <ms@kilabit.info>2026-01-22 14:57:20 +0700
commitfbad5db9b998ca64feaffee78ba680300d3a52a6 (patch)
tree1d8a9cd8bba88bf8daf64f5037fef9b110644f10 /Makefile
parentb20dc5c85b418b7167b3fb7866c7ea9a9fa0a705 (diff)
downloadlilin-fbad5db9b998ca64feaffee78ba680300d3a52a6.tar.xz
Makefile: add task for build and deploy to internal kilabit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f70d28a..82ceffc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,18 @@
## SPDX-License-Identifier: GPL-3.0-only
## SPDX-FileCopyrightText: 2025 M. Shulhan <ms@kilabit.info>
+VERSION=$(shell git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
+
.PHONY: all
all: lint test
+.PHONY: build
+build: LD_FLAGS+=-X 'git.sr.ht/~shulhan/lilin.Version=$(VERSION)'
+build:
+ go build \
+ -ldflags="$(LD_FLAGS)" \
+ ./cmd/lilin/
+
.PHONY: lint
lint:
go vet ./...
@@ -28,3 +37,8 @@ dev.test:
.PHONY: serve.docs
serve.docs:
ciigo serve _www/doc
+
+.PHONY: deploy.kilabit
+deploy.kilabit: build
+ rsync lilin lilin.kilabit.internal:~/bin/lilin
+ ssh lilin.kilabit.internal "sudo systemctl restart lilin.service"