Add Taskfile

Adds a taskfile to compile weblug.

Signed-off-by: phoenix <felix@feldspaten.org>
This commit is contained in:
Felix Niederwanger 2023-09-04 20:50:30 +02:00
parent a4e21288db
commit c3347383a1
Signed by: phoenix
GPG key ID: 6E77A590E3F6D71C
2 changed files with 24 additions and 1 deletions

View file

@ -21,7 +21,12 @@ This starts the webserver and listens for incoming webhooks.
make # Build weblug
make static # Make a static binary
Alternatively you there is also a [Taskfile](https://taskfile.dev)
task
task static # Build 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.
This file can be placed in `/etc/systemd/system/weblug.service` and in conjunction with an adequate `weblug.yml` file e.g. in `/etc/weblug.yml` this provides a way of running weblug as a native systemd service.
This file can be placed in `/etc/systemd/system/weblug.service` and in conjunction with an adequate `weblug.yml` file e.g. in `/etc/weblug.yml` this provides a way of running weblug as a native systemd service.

18
Taskfile.yml Normal file
View file

@ -0,0 +1,18 @@
# https://taskfile.dev
version: '3'
vars:
GREETING: Hello, World!
tasks:
default:
cmds:
- go build -o weblug cmd/weblug/*.go
# silent: true
static:
cmds:
- CGO_ENABLED=0 go build -ldflags="-w -s" -o weblug cmd/weblug/*.go
test:
cmds:
- sudo bash -c "cd test && ./blackbox.sh"