Commit 6bbced84d6

6bbced84d610d58d9f734a133dad044f265497f0

parent: 9eb3eb0b80

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-23 23:16 UTC

docs/demo: tapes recording signup to release on gitbay.org

vhs renders frames; render.sh encodes and joins them, since vhs 0.12's own ffmpeg step writes nothing under ffmpeg 9. env.sh gives the recording its own home, key and ssh config. A recorded tape is reused, since each writes to gitbay.org.

Ref #253
docs/demo/.gitignore added +1
@@ -0,0 +1 @@
1out/
docs/demo/common.tape added +14
@@ -0,0 +1,14 @@
1Set Shell bash
2Set FontFamily "Atkinson Hyperlegible Mono"
3Set FontSize 20
4Set Width 1280
5Set Height 720
6Set Padding 32
7Set TypingSpeed 35ms
8Set WaitPattern /\$$/
9Set Theme { "name": "gitbay", "black": "#000000", "red": "#ff6b6b", "green": "#5fd38d", "yellow": "#ffb454", "blue": "#6cb6ff", "magenta": "#d2a8ff", "cyan": "#76e3ea", "white": "#e6e6e6", "brightBlack": "#6e7681", "brightRed": "#ff8e8e", "brightGreen": "#7ee2a8", "brightYellow": "#ffc777", "brightBlue": "#8cc8ff", "brightMagenta": "#e2c5ff", "brightCyan": "#a5f0f5", "brightWhite": "#ffffff", "background": "#0b0b0b", "foreground": "#e6e6e6", "selection": "#333333", "cursor": "#ff8c1a" }
10
11Hide
12Type "source docs/demo/env.sh && clear" Enter
13Sleep 1s
14Show
docs/demo/env.sh added +25
@@ -0,0 +1,25 @@
1# Sourced by the tapes. Gives the recording a home of its own so the
2# demo account's key, known_hosts, git identity and CLI profile never
3# touch the operator's. OpenSSH reads ~ from the password database, not
4# $HOME, so ssh is wrapped to pass -F explicitly. The home stays short:
5# the CLI's ControlPath lives under it and a Unix socket path caps at 104.
6DEMO_HOME=${DEMO_HOME:-$HOME/.gitbay-demo}
7mkdir -p "$DEMO_HOME/.ssh" "$DEMO_HOME/bin" "$DEMO_HOME/.config/gitbay" "$DEMO_HOME/work"
8chmod 700 "$DEMO_HOME/.ssh"
9[ -f "$DEMO_HOME/.ssh/id_ed25519" ] ||
10 ssh-keygen -q -t ed25519 -f "$DEMO_HOME/.ssh/id_ed25519" -N '' -C zerocool
11[ -s "$DEMO_HOME/.ssh/known_hosts" ] ||
12 ssh-keygen -F gitbay.org | grep -v '^#' > "$DEMO_HOME/.ssh/known_hosts"
13printf 'Host *\n IdentityFile %s\n IdentitiesOnly yes\n IdentityAgent none\n UserKnownHostsFile %s\n' \
14 "$DEMO_HOME/.ssh/id_ed25519" "$DEMO_HOME/.ssh/known_hosts" > "$DEMO_HOME/.ssh/config"
15printf '#!/bin/sh\nexec /usr/bin/ssh -F "%s" "$@"\n' "$DEMO_HOME/.ssh/config" > "$DEMO_HOME/bin/ssh"
16chmod +x "$DEMO_HOME/bin/ssh"
17printf '[user]\n\tname = Zero Cool\n\temail = zerocool@gitbay.org\n[init]\n\tdefaultBranch = main\n' \
18 > "$DEMO_HOME/.gitconfig"
19printf 'default = "gitbay"\n\n[instances.gitbay]\nhost = "gitbay.org"\n' \
20 > "$DEMO_HOME/.config/gitbay/config.toml"
21
22export HOME=$DEMO_HOME PATH=$DEMO_HOME/bin:$PATH EDITOR=true
23unset SSH_AUTH_SOCK XDG_CONFIG_HOME
24PS1='\[\e[38;5;208m\]\W\[\e[0m\] $ '
25cd "$DEMO_HOME/work"
docs/demo/render.sh added +30
@@ -0,0 +1,30 @@
1#!/bin/sh
2# Render tapes to frames with vhs and encode them here: vhs 0.12's own
3# ffmpeg step writes nothing under ffmpeg 9. Several tapes are joined in
4# order. A tape already recorded is reused: the tapes write to gitbay.org,
5# so delete docs/demo/out/<name> to record one again. Writes
6# docs/demo/out/demo.{mp4,webm,gif}.
7#
8# DEMO_CODE=<mailed code> docs/demo/render.sh signup verify ship
9set -eu
10cd "$(dirname "$0")/../.."
11out=docs/demo/out
12bg=0b0b0b
13list=$out/concat.txt
14mkdir -p "$out"
15: > "$list"
16for name in "$@"; do
17 [ -d "$out/$name" ] || vhs "docs/demo/$name.tape"
18 ffmpeg -loglevel error -y \
19 -framerate 50 -i "$out/$name/frame-text-%05d.png" \
20 -framerate 50 -i "$out/$name/frame-cursor-%05d.png" \
21 -filter_complex "[0][1]overlay,pad=1248:688:32:32:color=$bg" \
22 -c:v libx264 -pix_fmt yuv420p -r 25 "$out/$name.mp4"
23 echo "file '$name.mp4'" >> "$list"
24done
25ffmpeg -loglevel error -y -f concat -safe 0 -i "$list" -c copy "$out/demo.mp4"
26ffmpeg -loglevel error -y -i "$out/demo.mp4" -c:v libvpx-vp9 -b:v 0 -crf 40 "$out/demo.webm"
27ffmpeg -loglevel error -y -i "$out/demo.mp4" \
28 -vf "fps=10,scale=960:-1:flags=lanczos,split[a][b];[a]palettegen=max_colors=32[p];[b][p]paletteuse=dither=none" \
29 "$out/demo.gif"
30ls -l "$out"/demo.*
docs/demo/ship.tape added +52
@@ -0,0 +1,52 @@
1# Part three: repository, issue, branch, merge request, merge, release,
2# as the account verify.tape activated.
3Output docs/demo/out/ship/
4Source docs/demo/common.tape
5
6Type "gitbay repo create zerocool/hello" Enter
7Wait
8Sleep 1.2s
9Type "git clone -q ssh://git@gitbay.org/zerocool/hello.git && cd hello" Enter
10Wait
11Sleep 1.2s
12Type "echo 'hello, world' > README && git add README && git commit -qm 'Say hello'" Enter
13Wait
14Sleep 1.2s
15Type "git push -q origin main" Enter
16Wait
17Sleep 1.2s
18Ctrl+L
19Sleep 400ms
20
21Type "gitbay issue create --title 'Say hello in French' --body 'Bonjour.'" Enter
22Wait
23Sleep 1.2s
24Type "git switch -qc fr && echo 'bonjour, le monde' >> README" Enter
25Wait
26Sleep 1.2s
27Type "git commit -qam 'Say bonjour' && git push -q origin fr" Enter
28Wait
29Sleep 1.2s
30Type "gitbay mr create --source fr --target main --title Bonjour --body 'Closes #1'" Enter
31Wait
32Sleep 1.2s
33Type "gitbay mr merge 1 --strategy squash" Enter
34Wait
35Sleep 1.2s
36Type "gitbay issue list --state closed" Enter
37Wait
38Sleep 1.2s
39Ctrl+L
40Sleep 400ms
41
42Type "# ship it" Enter
43Sleep 600ms
44Type "git switch -q main && git pull -q && git tag v0.1.0 && git push -q origin v0.1.0" Enter
45Wait
46Sleep 1.2s
47Type "gitbay release create v0.1.0 --notes 'Hello in two languages.'" Enter
48Wait
49Sleep 1.2s
50Type "gitbay release list" Enter
51Wait
52Sleep 1.2s
docs/demo/signup.tape added +11
@@ -0,0 +1,11 @@
1# Part one: an SSH key is the account. Registration mails a code, so the
2# recording stops here; ship.tape picks up with the code.
3Output docs/demo/out/signup/
4Source docs/demo/common.tape
5
6Type "# no account yet, just an SSH key" Enter
7Sleep 800ms
8Type "ssh git@gitbay.org whoami" Enter
9Sleep 2.5s
10Type "ssh git@gitbay.org register --username zerocool --email zerocool@gitbay.org" Enter
11Sleep 4s
docs/demo/verify.tape added +13
@@ -0,0 +1,13 @@
1# Part two: the code signup.tape's register mailed, as DEMO_CODE. A code
2# works once, so a rerun needs a fresh account.
3Output docs/demo/out/verify/
4Source docs/demo/common.tape
5
6Hide
7Type "code=$DEMO_CODE && clear" Enter
8Sleep 500ms
9Show
10Type "# the code from the mail" Enter
11Sleep 600ms
12Type "ssh git@gitbay.org email verify $code" Enter
13Sleep 2s