standardized JAR naming to gittally.jar (version-free); updated scripts, docs, and build config to align; added --version support via BuildProperties

This commit is contained in:
Michael Hoennig
2026-07-08 22:45:23 +02:00
parent d0b38c557a
commit 347efc16c5
9 changed files with 38 additions and 18 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ Detailed guides live as Agent Skills under `.claude/skills/` ([SKILL.md format](
Run the JAR directly: Run the JAR directly:
```bash ```bash
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar --help java -jar build/libs/gittally.jar --help
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar init java -jar build/libs/gittally.jar init
``` ```
`ktlintFormat` must be run before `build` passes — the formatter is enforced as part of the `check` lifecycle. `ktlintFormat` must be run before `build` passes — the formatter is enforced as part of the `check` lifecycle.
+7 -1
View File
@@ -9,7 +9,7 @@ plugins {
} }
group = "de.hoennig" group = "de.hoennig"
version = "0.1.0-SNAPSHOT" version = "0.9.0"
java { java {
toolchain { toolchain {
@@ -63,6 +63,12 @@ springBoot {
} }
} }
tasks.bootJar {
// version-free jar name, so docs and scripts never contain the version;
// the version itself stays available via BuildProperties (UI footer, --version)
archiveFileName = "gittally.jar"
}
kotlin { kotlin {
compilerOptions { compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict") freeCompilerArgs.addAll("-Xjsr305=strict")
+4 -4
View File
@@ -161,13 +161,13 @@ Ob ein neuer Commit den laufenden Build seines Branches stattdessen abbrechen so
### Initialisierung ### Initialisierung
```bash ```bash
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar init java -jar build/libs/gittally.jar init
``` ```
### Serverstart ### Serverstart
```bash ```bash
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar server java -jar build/libs/gittally.jar server
``` ```
Für den Dauerbetrieb als systemd-User-Service siehe [deployment.md](deployment.md) (`init --systemd`). Für den Dauerbetrieb als systemd-User-Service siehe [deployment.md](deployment.md) (`init --systemd`).
@@ -175,8 +175,8 @@ Für den Dauerbetrieb als systemd-User-Service siehe [deployment.md](deployment.
### Konfigurationsanzeige ### Konfigurationsanzeige
```bash ```bash
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar config:print java -jar build/libs/gittally.jar config:print
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar config:print --full java -jar build/libs/gittally.jar config:print --full
``` ```
## Erweiterungen ## Erweiterungen
+3 -3
View File
@@ -23,7 +23,7 @@ First, in `<gittally-root>`, build the application to generate the executable JA
Then run `init` using the generated JAR (not the `-plain.jar`): Then run `init` using the generated JAR (not the `-plain.jar`):
```bash ```bash
java -jar <gittally-root>/build/libs/gittally-0.1.0-SNAPSHOT.jar init java -jar <gittally-root>/build/libs/gittally.jar init
``` ```
`init` performs the following steps in order: `init` performs the following steps in order:
@@ -120,11 +120,11 @@ Until then, a Java runtime must be available on the host.
2. Review `.gittally.yml` and add/adjust any branch build settings. 2. Review `.gittally.yml` and add/adjust any branch build settings.
3. Verify the effective configuration: 3. Verify the effective configuration:
```bash ```bash
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar config:print --full java -jar build/libs/gittally.jar config:print --full
``` ```
4. Start the server: 4. Start the server:
```bash ```bash
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar server java -jar build/libs/gittally.jar server
``` ```
5. For permanent operation, install the systemd user service described in [deployment.md](deployment.md). 5. For permanent operation, install the systemd user service described in [deployment.md](deployment.md).
+2 -2
View File
@@ -14,8 +14,8 @@ The repo install config (`.git/gittally/.gittally.yml`) wins on any key present
## Inspect the Effective Config ## Inspect the Effective Config
```bash ```bash
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar config:print # only explicitly set values java -jar build/libs/gittally.jar config:print # only explicitly set values
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar config:print --full # all values including defaults java -jar build/libs/gittally.jar config:print --full # all values including defaults
``` ```
## `.gittally.yml` ## `.gittally.yml`
+2 -2
View File
@@ -19,14 +19,14 @@ Build the executable jar once:
```bash ```bash
./gradlew build ./gradlew build
ls build/libs/gittally-*-SNAPSHOT.jar ls build/libs/gittally.jar
``` ```
Copy the jar to a stable path outside any watched repository, by convention `~/bin/gittally.jar`: Copy the jar to a stable path outside any watched repository, by convention `~/bin/gittally.jar`:
```bash ```bash
mkdir -p ~/bin mkdir -p ~/bin
cp build/libs/gittally-0.1.0-SNAPSHOT.jar ~/bin/gittally.jar cp build/libs/gittally.jar ~/bin/gittally.jar
``` ```
The systemd unit generated below points at the jar that was used to run `init --systemd`. The systemd unit generated below points at the jar that was used to run `init --systemd`.
+1 -2
View File
@@ -21,8 +21,7 @@ ORIGIN_URL="${ORIGIN_URL:-$(git -C "$DEV_CHECKOUT" remote get-url origin)}"
# 2. Dedicated clone: builds run in worktrees under its .git/gittally/worktrees, # 2. Dedicated clone: builds run in worktrees under its .git/gittally/worktrees,
# completely separate from your dev checkout. # completely separate from your dev checkout.
mkdir -p "$INSTALL_DIR" mkdir -p "$INSTALL_DIR"
JAR=$(ls "$DEV_CHECKOUT"/build/libs/gittally-*.jar | grep -v -- '-plain' | head -1) cp "$DEV_CHECKOUT/build/libs/gittally.jar" "$INSTALL_DIR/gittally.jar"
cp "$JAR" "$INSTALL_DIR/gittally.jar"
if [ ! -d "$INSTALL_DIR/repo/.git" ]; then if [ ! -d "$INSTALL_DIR/repo/.git" ]; then
git clone "$ORIGIN_URL" "$INSTALL_DIR/repo" git clone "$ORIGIN_URL" "$INSTALL_DIR/repo"
fi fi
+1 -2
View File
@@ -24,8 +24,7 @@ DEV_CHECKOUT=$(git rev-parse --show-toplevel)
# 1. Build the GitTally jar. # 1. Build the GitTally jar.
(cd "$DEV_CHECKOUT" && ./gradlew --console=plain build) (cd "$DEV_CHECKOUT" && ./gradlew --console=plain build)
mkdir -p "$INSTALL_DIR" mkdir -p "$INSTALL_DIR"
JAR=$(ls "$DEV_CHECKOUT"/build/libs/gittally-*.jar | grep -v -- '-plain' | head -1) cp "$DEV_CHECKOUT/build/libs/gittally.jar" "$INSTALL_DIR/gittally.jar"
cp "$JAR" "$INSTALL_DIR/gittally.jar"
# 2. Scratch bare origin plus a "work" clone for triggering builds by pushing. # 2. Scratch bare origin plus a "work" clone for triggering builds by pushing.
if [ ! -d "$INSTALL_DIR/origin.git" ]; then if [ ! -d "$INSTALL_DIR/origin.git" ]; then
@@ -6,6 +6,8 @@ import de.hoennig.gittally.commands.InitCommand
import de.hoennig.gittally.commands.RetryCommand import de.hoennig.gittally.commands.RetryCommand
import de.hoennig.gittally.commands.ServerCommand import de.hoennig.gittally.commands.ServerCommand
import de.hoennig.gittally.commands.StatusCommand import de.hoennig.gittally.commands.StatusCommand
import org.springframework.beans.factory.ObjectProvider
import org.springframework.boot.info.BuildProperties
import org.springframework.stereotype.Component import org.springframework.stereotype.Component
import picocli.CommandLine import picocli.CommandLine
import picocli.CommandLine.Command import picocli.CommandLine.Command
@@ -22,8 +24,22 @@ import picocli.CommandLine.Command
ConfigPrintCommand::class, ConfigPrintCommand::class,
], ],
mixinStandardHelpOptions = true, mixinStandardHelpOptions = true,
versionProvider = BuildPropertiesVersionProvider::class,
description = ["Lightweight, declarative CI/CD system"], description = ["Lightweight, declarative CI/CD system"],
) )
class GitTallyCommand : Runnable { class GitTallyCommand : Runnable {
override fun run(): Unit = throw CommandLine.ParameterException(CommandLine(this), "Specify a subcommand") override fun run(): Unit = throw CommandLine.ParameterException(CommandLine(this), "Specify a subcommand")
} }
/**
* Feeds `--version` from the Gradle project version via the `build-info`
* [BuildProperties] — the same source as the web UI footer, so the version is
* declared only in `build.gradle.kts`. Resolved through picocli's Spring factory;
* `dev` when running from classes (IDE, tests) where no build info exists.
*/
@Component
class BuildPropertiesVersionProvider(
private val buildProperties: ObjectProvider<BuildProperties>,
) : CommandLine.IVersionProvider {
override fun getVersion(): Array<String> = arrayOf("GitTally v${buildProperties.getIfAvailable()?.version ?: "dev"}")
}