run.sh RawHistoryFolder

1#!/usr/bin/env bash
2set -euo pipefail
3cd "$(dirname "$0")/../.."
4
5TAPE="${1:-demo.tape}"
6COMPOSE_FILE="scripts/demo/compose.demo.yaml"
7install -d -m 0777 scripts/demo/out
8
9compose() {
10	docker compose -f "$COMPOSE_FILE" "$@"
11}
12
13cleanup() {
14	compose down -v --remove-orphans >/dev/null 2>&1 || true
15}
16trap cleanup EXIT
17
18# Start from a fresh named volume for the client's vev state.
19cleanup
20compose up -d remote-a
21
22ready=""
23for _ in $(seq 60); do
24	if compose run --rm --entrypoint ssh client remote-a true >/dev/null 2>&1; then
25		ready=yes
26		break
27	fi
28	sleep 0.5
29done
30if [ -z "$ready" ]; then
31	echo "error: sshd on the remote container never accepted a connection" >&2
32	compose logs remote-a >&2 || true
33	exit 1
34fi
35
36start_remote_session() {
37	local name=$1 scene=$2
38	# `vev new` needs a sized terminal. Attach briefly inside a pseudo-terminal;
39	# the named session survives when the timeout ends the client.
40	# timeout exits 124 when it ends the attached client, the expected path.
41	local status=0
42	compose exec -u demo -T remote-a env TERM=xterm-256color VEV_DEMO_SCENE="$scene" SHELL=/bin/bash \
43		timeout 3 script -qec "stty cols 120 rows 40; SHELL=/usr/local/bin/demo-shell vev new $name" /dev/null >/dev/null 2>&1 || status=$?
44	if [ "$status" -ne 124 ]; then
45		echo "error: 'vev new $name' exited with status $status" >&2
46		return 1
47	fi
48	if ! compose exec -u demo -T remote-a vev ls | awk -v name="$name" '$1 == name && $2 == "up" { found = 1 } END { exit !found }'; then
49		echo "error: remote session '$name' was not retained" >&2
50		compose exec -u demo -T remote-a vev ls >&2 || true
51		return 1
52	fi
53}
54
55start_remote_session work remote-deploys
56start_remote_session ticker remote-ticker
57
58compose run --rm --entrypoint vev client host add remote-a
59compose run --rm client "/tape/$TAPE"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close