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
docs/demo/common.tape
added
+14
| @@ -0,0 +1,14 @@ |
| 1 | Set Shell bash |
| 2 | Set FontFamily "Atkinson Hyperlegible Mono" |
| 3 | Set FontSize 20 |
| 4 | Set Width 1280 |
| 5 | Set Height 720 |
| 6 | Set Padding 32 |
| 7 | Set TypingSpeed 35ms |
| 8 | Set WaitPattern /\$$/ |
| 9 | Set 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 | |
| 11 | Hide |
| 12 | Type "source docs/demo/env.sh && clear" Enter |
| 13 | Sleep 1s |
| 14 | Show |
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. |
| 6 | DEMO_HOME=${DEMO_HOME:-$HOME/.gitbay-demo} |
| 7 | mkdir -p "$DEMO_HOME/.ssh" "$DEMO_HOME/bin" "$DEMO_HOME/.config/gitbay" "$DEMO_HOME/work" |
| 8 | chmod 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" |
| 13 | printf '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" |
| 15 | printf '#!/bin/sh\nexec /usr/bin/ssh -F "%s" "$@"\n' "$DEMO_HOME/.ssh/config" > "$DEMO_HOME/bin/ssh" |
| 16 | chmod +x "$DEMO_HOME/bin/ssh" |
| 17 | printf '[user]\n\tname = Zero Cool\n\temail = zerocool@gitbay.org\n[init]\n\tdefaultBranch = main\n' \ |
| 18 | > "$DEMO_HOME/.gitconfig" |
| 19 | printf 'default = "gitbay"\n\n[instances.gitbay]\nhost = "gitbay.org"\n' \ |
| 20 | > "$DEMO_HOME/.config/gitbay/config.toml" |
| 21 | |
| 22 | export HOME=$DEMO_HOME PATH=$DEMO_HOME/bin:$PATH EDITOR=true |
| 23 | unset SSH_AUTH_SOCK XDG_CONFIG_HOME |
| 24 | PS1='\[\e[38;5;208m\]\W\[\e[0m\] $ ' |
| 25 | cd "$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 |
| 9 | set -eu |
| 10 | cd "$(dirname "$0")/../.." |
| 11 | out=docs/demo/out |
| 12 | bg=0b0b0b |
| 13 | list=$out/concat.txt |
| 14 | mkdir -p "$out" |
| 15 | : > "$list" |
| 16 | for 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" |
| 24 | done |
| 25 | ffmpeg -loglevel error -y -f concat -safe 0 -i "$list" -c copy "$out/demo.mp4" |
| 26 | ffmpeg -loglevel error -y -i "$out/demo.mp4" -c:v libvpx-vp9 -b:v 0 -crf 40 "$out/demo.webm" |
| 27 | ffmpeg -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" |
| 30 | ls -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. |
| 3 | Output docs/demo/out/ship/ |
| 4 | Source docs/demo/common.tape |
| 5 | |
| 6 | Type "gitbay repo create zerocool/hello" Enter |
| 7 | Wait |
| 8 | Sleep 1.2s |
| 9 | Type "git clone -q ssh://git@gitbay.org/zerocool/hello.git && cd hello" Enter |
| 10 | Wait |
| 11 | Sleep 1.2s |
| 12 | Type "echo 'hello, world' > README && git add README && git commit -qm 'Say hello'" Enter |
| 13 | Wait |
| 14 | Sleep 1.2s |
| 15 | Type "git push -q origin main" Enter |
| 16 | Wait |
| 17 | Sleep 1.2s |
| 18 | Ctrl+L |
| 19 | Sleep 400ms |
| 20 | |
| 21 | Type "gitbay issue create --title 'Say hello in French' --body 'Bonjour.'" Enter |
| 22 | Wait |
| 23 | Sleep 1.2s |
| 24 | Type "git switch -qc fr && echo 'bonjour, le monde' >> README" Enter |
| 25 | Wait |
| 26 | Sleep 1.2s |
| 27 | Type "git commit -qam 'Say bonjour' && git push -q origin fr" Enter |
| 28 | Wait |
| 29 | Sleep 1.2s |
| 30 | Type "gitbay mr create --source fr --target main --title Bonjour --body 'Closes #1'" Enter |
| 31 | Wait |
| 32 | Sleep 1.2s |
| 33 | Type "gitbay mr merge 1 --strategy squash" Enter |
| 34 | Wait |
| 35 | Sleep 1.2s |
| 36 | Type "gitbay issue list --state closed" Enter |
| 37 | Wait |
| 38 | Sleep 1.2s |
| 39 | Ctrl+L |
| 40 | Sleep 400ms |
| 41 | |
| 42 | Type "# ship it" Enter |
| 43 | Sleep 600ms |
| 44 | Type "git switch -q main && git pull -q && git tag v0.1.0 && git push -q origin v0.1.0" Enter |
| 45 | Wait |
| 46 | Sleep 1.2s |
| 47 | Type "gitbay release create v0.1.0 --notes 'Hello in two languages.'" Enter |
| 48 | Wait |
| 49 | Sleep 1.2s |
| 50 | Type "gitbay release list" Enter |
| 51 | Wait |
| 52 | Sleep 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. |
| 3 | Output docs/demo/out/signup/ |
| 4 | Source docs/demo/common.tape |
| 5 | |
| 6 | Type "# no account yet, just an SSH key" Enter |
| 7 | Sleep 800ms |
| 8 | Type "ssh git@gitbay.org whoami" Enter |
| 9 | Sleep 2.5s |
| 10 | Type "ssh git@gitbay.org register --username zerocool --email zerocool@gitbay.org" Enter |
| 11 | Sleep 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. |
| 3 | Output docs/demo/out/verify/ |
| 4 | Source docs/demo/common.tape |
| 5 | |
| 6 | Hide |
| 7 | Type "code=$DEMO_CODE && clear" Enter |
| 8 | Sleep 500ms |
| 9 | Show |
| 10 | Type "# the code from the mail" Enter |
| 11 | Sleep 600ms |
| 12 | Type "ssh git@gitbay.org email verify $code" Enter |
| 13 | Sleep 2s |