example-config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# 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.
# task params
# fetch [url]: fetch resource from url
# every [interval]: execute this task every $interval
# exec
#
# fetch params
# changed: what to do if the remote file changes
binary j3s.sh {
fetch https://git.j3s.sh/j3s.sh
exec go build .
}
task run my website {
require binary j3s.sh
if binary j3s.sh changes restart task
command j3s.sh
env whatever
args -one -two -three
}
fetch an artifact
run a process
when the fetched artifact changes, restart the process