Add Taskfile

Adds a Taskfile for easier building. This should replace the Makefile
one day.
This commit is contained in:
Felix Niederwanger 2023-06-12 16:29:47 +02:00
parent cec58caffe
commit e8fc0f14d5
Signed by: phoenix
GPG key ID: 31860289A704FB3C
2 changed files with 20 additions and 2 deletions

View file

@ -34,9 +34,10 @@ In it's current implementation, `weblug` requires to remain running as root with
## Build
make # Build weblug
make static # Make a static binary
I'm using a [taskfile](https://taskfile.dev/) for build recipes. The `Makefile` is still kept for OBS and backwards compatability.
task build # Build weblug
task build-static # Build a static binary
## Run as systemd unit
This repository provides an example [weblug.service](weblug.service), which can be used to start `weblug` as systemd service.

17
Taskfile.yml Normal file
View file

@ -0,0 +1,17 @@
---
# See https://taskfile.dev/
version: '3'
tasks:
build:
cmds:
- go build -o weblug cmd/weblug/*.go
build-static:
cmds:
- CGO_ENABLED=0 go build -ldflags="-w -s" -o weblug cmd/weblug/*.go
test:
cmds:
- go test ./...
- sudo bash -c "cd test && ./blackbox.sh"