diff --git a/docs/bootstrapping.md b/docs/bootstrapping.md index 8255af6..75a3725 100644 --- a/docs/bootstrapping.md +++ b/docs/bootstrapping.md @@ -132,6 +132,7 @@ Until then, a Java runtime must be available on the host. [examples/setup-gittally-testserver.sh](examples/setup-gittally-testserver.sh) starts a GitTally server against a scratch repository with a fake build — the setup used for the manual UI/API smoke tests during development. It creates a local bare origin plus a `work` clone, commits a slow fake build script (live log output, demo report artifact) with a `pollInterval: 5s` config, and starts the server on port 18980. +The origin gets a second branch (`feature/demo`), so the Branches view shows more than one entry. No Gitea, no credentials, no Docker; `INSTALL_DIR`, `SERVER_PORT`, and `BUILD_SECONDS` can be overridden via environment variables. While the server runs, push empty commits from the `work` clone to trigger builds; a commit message containing `[fail]` makes the build fail, and pushing a new branch exercises the new-origin-branch path. diff --git a/docs/examples/setup-gittally-testserver.sh b/docs/examples/setup-gittally-testserver.sh index 286e9c6..8e0b6ed 100755 --- a/docs/examples/setup-gittally-testserver.sh +++ b/docs/examples/setup-gittally-testserver.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash # Example: start a GitTally test server watching a scratch repository with a fake build. # This is the setup used for the manual UI/API smoke tests during development: -# a local bare origin, a slow fake build with live log output and a demo report -# artifact, and a fast poll interval — no Gitea, no credentials, no Docker. +# a local bare origin (with a second branch for the Branches view), a slow fake +# build with live log output and a demo report artifact, and a fast poll +# interval — no Gitea, no credentials, no Docker. # # Usage: # ./docs/examples/setup-gittally-testserver.sh @@ -73,6 +74,15 @@ EOF git -C "$INSTALL_DIR/work" push --quiet origin main fi +# A second branch on origin, so the Branches view shows more than just main. +# Guarded separately so existing installs gain it on a re-run. +if ! git -C "$INSTALL_DIR/origin.git" show-ref --quiet refs/heads/feature/demo; then + git -C "$INSTALL_DIR/work" switch --quiet -c feature/demo main + git -C "$INSTALL_DIR/work" commit --quiet --allow-empty -m "demo branch for the branches view" + git -C "$INSTALL_DIR/work" push --quiet -u origin feature/demo + git -C "$INSTALL_DIR/work" switch --quiet main +fi + # 3. The watched clone; the server runs here. No `init` needed: the project config # is committed, and without gitea.baseUrl/git.token no statuses are published. if [ ! -d "$INSTALL_DIR/repo/.git" ]; then