renaming from gitTally to Werkator

This commit is contained in:
mhoennig
2026-08-30 18:35:49 +02:00
parent 4d76744721
commit 7f550689dd
169 changed files with 1361 additions and 7504 deletions
+19 -19
View File
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
# Example: set up a GitTally instance that watches and builds GitTally itself.
# Run from inside a working checkout of the gittally repository.
# Example: set up a werkator instance that watches and builds werkator itself.
# Run from inside a working checkout of the werkator repository.
#
# Usage:
# GIT_ACCOUNT=mi GIT_TOKEN=xxxx ./docs/examples/setup-gittally-selfhost.sh
# GIT_ACCOUNT=mi GIT_TOKEN=xxxx ./docs/examples/setup-werkator-selfhost.sh
# (both empty is fine for a public origin — commit statuses just won't be published)
set -euo pipefail
INSTALL_DIR="${INSTALL_DIR:-$HOME/gittally-selfhost}"
INSTALL_DIR="${INSTALL_DIR:-$HOME/werkator-selfhost}"
GIT_ACCOUNT="${GIT_ACCOUNT:-}" # technical Gitea user for HTTPS fetch + status API
GIT_TOKEN="${GIT_TOKEN:-}" # Gitea API token — stays in the uncommitted config file
SERVER_PORT="${SERVER_PORT:-18080}"
@@ -15,45 +15,45 @@ SERVER_PORT="${SERVER_PORT:-18080}"
DEV_CHECKOUT=$(git rev-parse --show-toplevel)
ORIGIN_URL="${ORIGIN_URL:-$(git -C "$DEV_CHECKOUT" remote get-url origin)}"
# 1. Build the GitTally jar — the last Gradle run you ever start by hand.
# 1. Build the werkator jar — the last Gradle run you ever start by hand.
(cd "$DEV_CHECKOUT" && ./gradlew --console=plain build)
# 2. Dedicated clone: builds run in worktrees under its .git/gittally/worktrees,
# 2. Dedicated clone: builds run in worktrees under its .git/werkator/worktrees,
# completely separate from your dev checkout.
mkdir -p "$INSTALL_DIR"
cp "$DEV_CHECKOUT/build/libs/gittally.jar" "$INSTALL_DIR/gittally.jar"
cp "$DEV_CHECKOUT/build/libs/werkator.jar" "$INSTALL_DIR/werkator.jar"
if [ ! -d "$INSTALL_DIR/repo/.git" ]; then
git clone "$ORIGIN_URL" "$INSTALL_DIR/repo"
fi
cd "$INSTALL_DIR/repo"
# 3. Generate the config templates; existing files are kept. The clone already
# carries the committed .gittally.yml, so this only creates the machine config
# (.git/gittally/.gittally.yml).
java -jar "$INSTALL_DIR/gittally.jar" init
# carries the committed .werkator.yml, so this only creates the machine config
# (.git/werkator/.werkator.yml).
java -jar "$INSTALL_DIR/werkator.jar" init
# 4. Machine-specific overrides and secrets (.git/gittally/ is never committed;
# this file deep-merges over .gittally.yml and wins).
cat > .git/gittally/.gittally.yml <<EOF
# 4. Machine-specific overrides and secrets (.git/werkator/ is never committed;
# this file deep-merges over .werkator.yml and wins).
cat > .git/werkator/.werkator.yml <<EOF
git:
account: "$GIT_ACCOUNT"
token: "$GIT_TOKEN"
server:
port: $SERVER_PORT
EOF
chmod 600 .git/gittally/.gittally.yml
chmod 600 .git/werkator/.werkator.yml
# The committed .gittally.yml already builds GitTally itself:
# The committed .werkator.yml already builds werkator itself:
# buildCommand: ./gradlew --console=plain --no-daemon test
# artifactDirs: [build/reports]
# 5. Optional kick-start: put the local ref one commit behind origin so the very
# first poll triggers a build — otherwise GitTally waits for the next push.
# first poll triggers a build — otherwise werkator waits for the next push.
# Builds never move this ref or touch this checkout, so lagging is harmless.
git reset --hard --quiet HEAD~1 || true
# 6. Run it (Ctrl-C stops it cleanly). For a permanent setup, run
# `java -jar "$INSTALL_DIR/gittally.jar" init --systemd` here instead and follow
# `java -jar "$INSTALL_DIR/werkator.jar" init --systemd` here instead and follow
# docs/deployment.md — the generated unit points at this jar and repo.
echo "GitTally self-host: http://localhost:$SERVER_PORT/ — watching $ORIGIN_URL"
exec java -jar "$INSTALL_DIR/gittally.jar" server
echo "werkator self-host: http://localhost:$SERVER_PORT/ — watching $ORIGIN_URL"
exec java -jar "$INSTALL_DIR/werkator.jar" server
+14 -14
View File
@@ -1,30 +1,30 @@
#!/usr/bin/env bash
# Example: start a GitTally test server watching a scratch repository with a fake build.
# Example: start a werkator 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 (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
# BUILD_SECONDS=5 SERVER_PORT=18981 ./docs/examples/setup-gittally-testserver.sh
# ./docs/examples/setup-werkator-testserver.sh
# BUILD_SECONDS=5 SERVER_PORT=18981 ./docs/examples/setup-werkator-testserver.sh
#
# While the server runs, trigger builds by pushing from the "work" clone:
# git -C ~/gittally-testserver/work commit --allow-empty -m "trigger build" && git -C ~/gittally-testserver/work push
# git -C ~/werkator-testserver/work commit --allow-empty -m "trigger build" && git -C ~/werkator-testserver/work push
# A commit message containing "[fail]" makes the fake build fail;
# pushing a new branch exercises the new-origin-branch path.
set -euo pipefail
INSTALL_DIR="${INSTALL_DIR:-$HOME/gittally-testserver}"
INSTALL_DIR="${INSTALL_DIR:-$HOME/werkator-testserver}"
SERVER_PORT="${SERVER_PORT:-18980}"
export BUILD_SECONDS="${BUILD_SECONDS:-25}" # inherited by the build process at runtime
DEV_CHECKOUT=$(git rev-parse --show-toplevel)
# 1. Build the GitTally jar.
# 1. Build the werkator jar.
(cd "$DEV_CHECKOUT" && ./gradlew --console=plain build)
mkdir -p "$INSTALL_DIR"
cp "$DEV_CHECKOUT/build/libs/gittally.jar" "$INSTALL_DIR/gittally.jar"
cp "$DEV_CHECKOUT/build/libs/werkator.jar" "$INSTALL_DIR/werkator.jar"
# 2. Scratch bare origin plus a "work" clone for triggering builds by pushing.
if [ ! -d "$INSTALL_DIR/origin.git" ]; then
@@ -39,7 +39,7 @@ if ! git -C "$INSTALL_DIR/work" rev-parse --quiet --verify HEAD >/dev/null; then
cat > "$INSTALL_DIR/work/fake-build.sh" <<'EOF'
#!/usr/bin/env bash
# Fake build: visible progress for the live log, then a demo report artifact.
# GitTally exports `branch`; BUILD_SECONDS is inherited from the server process.
# werkator exports `branch`; BUILD_SECONDS is inherited from the server process.
set -euo pipefail
echo "fake build of branch ${branch:-unknown} at commit $(git rev-parse --short HEAD)"
if git log -1 --pretty=%s | grep -qF '[fail]'; then
@@ -56,7 +56,7 @@ printf '<!DOCTYPE html><html><body><h1>Demo Report</h1><p>branch %s, commit %s</
echo "fake build done"
EOF
chmod +x "$INSTALL_DIR/work/fake-build.sh"
cat > "$INSTALL_DIR/work/.gittally.yml" <<'EOF'
cat > "$INSTALL_DIR/work/.werkator.yml" <<'EOF'
watcher:
pollInterval: 5s
@@ -67,7 +67,7 @@ branches:
artifactDirs:
- build/reports
EOF
git -C "$INSTALL_DIR/work" add fake-build.sh .gittally.yml
git -C "$INSTALL_DIR/work" add fake-build.sh .werkator.yml
git -C "$INSTALL_DIR/work" commit --quiet -m "fake build setup"
git -C "$INSTALL_DIR/work" commit --quiet --allow-empty -m "kick-start build"
git -C "$INSTALL_DIR/work" push --quiet origin main
@@ -88,8 +88,8 @@ if [ ! -d "$INSTALL_DIR/repo/.git" ]; then
git clone --quiet "$INSTALL_DIR/origin.git" "$INSTALL_DIR/repo"
fi
cd "$INSTALL_DIR/repo"
mkdir -p .git/gittally
cat > .git/gittally/.gittally.yml <<EOF
mkdir -p .git/werkator
cat > .git/werkator/.werkator.yml <<EOF
server:
port: $SERVER_PORT
bindAddress: 127.0.0.1
@@ -101,8 +101,8 @@ git reset --hard --quiet HEAD~1 || true
# 5. Run it (Ctrl-C stops it cleanly).
echo
echo "GitTally test server: http://localhost:$SERVER_PORT/"
echo "werkator test server: http://localhost:$SERVER_PORT/"
echo "Trigger a build: git -C $INSTALL_DIR/work commit --allow-empty -m 'trigger build' && git -C $INSTALL_DIR/work push"
echo "Trigger a failure: same with commit message 'trigger [fail]'"
echo
exec java -jar "$INSTALL_DIR/gittally.jar" server
exec java -jar "$INSTALL_DIR/werkator.jar" server