blob: 40433a84f42b13fd7ac6f8edc42a6e7a2761ac36 (
plain)
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
|
[tasks.gen]
run = "weft -gitignore . https://tjp.lol"
[tasks.clean]
description = "Remove Weft-generated outputs"
run = '''
if [ -f .weft-generated.json ]; then
jq -r '.outputs[]' .weft-generated.json | xargs -n 1 rm -f
else
awk '/^# BEGIN weft generated outputs$/ { generated = 1; next } /^# END weft generated outputs$/ { generated = 0 } generated { sub(/^\//, ""); print }' .gitignore | xargs -n 1 rm -f
fi
rm -f .weft-txn-*
'''
[tasks.dev]
description = "Run the auto-reloading dev server and open the site in a browser"
run = "(sleep 1 && open http://127.0.0.1:8001/) & exec air"
[tasks."deploy:weft"]
description = "Build and deploy weft to tjp.lol"
run = '''
set -euo pipefail
cd ../weft
env GOOS=freebsd GOARCH=amd64 go build -o weft-freebsd-amd64 .
trap 'rm weft-freebsd-amd64' EXIT
scp weft-freebsd-amd64 t@tjp.lol:weft
ssh t@tjp.lol "doas sh -c 'mv weft /jail/containers/code-push/usr/local/bin/weft && chown root:wheel /jail/containers/code-push/usr/local/bin/weft'"
'''
[tasks."deploy:site"]
description = "Push the current 'main' bookmark to deploy the site"
run = "jj git push -b main"
[tasks.deploy]
description = "Push the 'main' bookmark and update weft on the server"
depends = ["deploy:weft", "deploy:site"]
|