small pixel drawing of a pufferfish enby

in the beginning, there was darkness
Jes Olson j3s@c3f.net
Mon, 02 Jan 2023 19:56:54 -0800
commit

0bdfc4ae1efa52bfb602ad8a3783cac61a2db01b

3 files changed, 124 insertions(+), 0 deletions(-)

jump to
A README

@@ -0,0 +1,34 @@

+ shrapnl + a simple task machine + + features + - watch remote resources for changes - git repos, files, websites + - trigger actions periodically, or when resources change + - execute periodic tasks or full processes + - small & simple to get up and running + + + ideations + kind of like "nomad-lite" + + + warnings + shrapnl is brand spanking new + there is no process isolation by default, for now + + + usage + shrapnl + a simple task machine + + commands + [d]aemon [config] - Run shrapnl in daemon-mode. + [l]ogs [task] - Print stdout/stderr for a task. + [r]eload - Reload config file. + [s]tatus - Check the status of all tasks. + + + todo + strong process isolation by default + on linux + fail on bsd?
A example-config

@@ -0,0 +1,76 @@

+# todo: consider var support +# todo: auto-fetch + +# stored in /var/lib/wuji/artifact/??? +object prometheus url https://github.com/prometheus/prometheus/releases/download/v2.41.0/prometheus-2.41.0.linux-amd64.tar.gz \ + extract prometheus promtool + +action gobuild exec go build . + +process fetch prometheus exec ./prometheus + +wuji prometheus { + fetch object prometheus every 60m + exec ./prometheus +} + +wuji j3s.sh { + fetch artifact.prometheus + exec go run . +} + +wuji cake-timer { + every 6m + action send-email +} + +task prometheus { + artifact url https://github.com/prometheus/prometheus/releases/download/v2.41.0/prometheus-2.41.0.linux-amd64.tar.gz +} + + + + + + + + + + + + + + + +examples: + + task run my website { + fetch https://git.j3s.sh/j3s.sh protocol git + run go run . + } + watch /var/lib/sqlite.db + +action blocks define actions - they're basically +little shell snippets. + +you connect them by specifying actions +in your watch blocks. + +this is very simple in concept, but incredibly +useful in practice. + +# comments are shell-style + +j3s = "https://git.j3s.sh/j3s.sh" +every 5m fetch j3s + +watch(3m) https://git.j3s.sh/j3s.sh +action go run . + +wuji watch https://git.j3s.sh/j3s.sh every 5m action go-build + +wuji fetch https://git.j3s.sh/j3s.sh every 5m + > created wuji resource + + +when resource.
A shrapnl

@@ -0,0 +1,14 @@

+#!/bin/sh + + printf %s "\ + shrapnl + a simple task machine + + commands + [d]aemon [config] - Run shrapnl in daemon-mode. + [l]ogs [task] - Print stdout/stderr for a task. + [r]eload - Reload config file. + [s]tatus - Check the status of all tasks. +" + exit 0 +}