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:
@@ -16,8 +16,8 @@ Detailed guides live as Agent Skills under `.claude/skills/` ([SKILL.md format](
|
||||
Run the JAR directly:
|
||||
|
||||
```bash
|
||||
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar --help
|
||||
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar init
|
||||
java -jar build/libs/gittally.jar --help
|
||||
java -jar build/libs/gittally.jar init
|
||||
```
|
||||
|
||||
`ktlintFormat` must be run before `build` passes — the formatter is enforced as part of the `check` lifecycle.
|
||||
|
||||
+7
-1
@@ -9,7 +9,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "de.hoennig"
|
||||
version = "0.1.0-SNAPSHOT"
|
||||
version = "0.9.0"
|
||||
|
||||
java {
|
||||
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 {
|
||||
compilerOptions {
|
||||
freeCompilerArgs.addAll("-Xjsr305=strict")
|
||||
|
||||
@@ -161,13 +161,13 @@ Ob ein neuer Commit den laufenden Build seines Branches stattdessen abbrechen so
|
||||
### Initialisierung
|
||||
|
||||
```bash
|
||||
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar init
|
||||
java -jar build/libs/gittally.jar init
|
||||
```
|
||||
|
||||
### Serverstart
|
||||
|
||||
```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`).
|
||||
@@ -175,8 +175,8 @@ Für den Dauerbetrieb als systemd-User-Service siehe [deployment.md](deployment.
|
||||
### Konfigurationsanzeige
|
||||
|
||||
```bash
|
||||
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar config:print
|
||||
java -jar build/libs/gittally-0.1.0-SNAPSHOT.jar config:print --full
|
||||
java -jar build/libs/gittally.jar config:print
|
||||
java -jar build/libs/gittally.jar config:print --full
|
||||
```
|
||||
|
||||
## Erweiterungen
|
||||
|
||||
@@ -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`):
|
||||
|
||||
```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:
|
||||
@@ -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.
|
||||
3. Verify the effective configuration:
|
||||
```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:
|
||||
```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).
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ The repo install config (`.git/gittally/.gittally.yml`) wins on any key present
|
||||
## Inspect the Effective Config
|
||||
|
||||
```bash
|
||||
java -jar build/libs/gittally-0.1.0-SNAPSHOT.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 # only explicitly set values
|
||||
java -jar build/libs/gittally.jar config:print --full # all values including defaults
|
||||
```
|
||||
|
||||
## `.gittally.yml`
|
||||
|
||||
+2
-2
@@ -19,14 +19,14 @@ Build the executable jar once:
|
||||
|
||||
```bash
|
||||
./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`:
|
||||
|
||||
```bash
|
||||
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`.
|
||||
|
||||
@@ -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,
|
||||
# completely separate from your dev checkout.
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
JAR=$(ls "$DEV_CHECKOUT"/build/libs/gittally-*.jar | grep -v -- '-plain' | head -1)
|
||||
cp "$JAR" "$INSTALL_DIR/gittally.jar"
|
||||
cp "$DEV_CHECKOUT/build/libs/gittally.jar" "$INSTALL_DIR/gittally.jar"
|
||||
if [ ! -d "$INSTALL_DIR/repo/.git" ]; then
|
||||
git clone "$ORIGIN_URL" "$INSTALL_DIR/repo"
|
||||
fi
|
||||
|
||||
@@ -24,8 +24,7 @@ DEV_CHECKOUT=$(git rev-parse --show-toplevel)
|
||||
# 1. Build the GitTally jar.
|
||||
(cd "$DEV_CHECKOUT" && ./gradlew --console=plain build)
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
JAR=$(ls "$DEV_CHECKOUT"/build/libs/gittally-*.jar | grep -v -- '-plain' | head -1)
|
||||
cp "$JAR" "$INSTALL_DIR/gittally.jar"
|
||||
cp "$DEV_CHECKOUT/build/libs/gittally.jar" "$INSTALL_DIR/gittally.jar"
|
||||
|
||||
# 2. Scratch bare origin plus a "work" clone for triggering builds by pushing.
|
||||
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.ServerCommand
|
||||
import de.hoennig.gittally.commands.StatusCommand
|
||||
import org.springframework.beans.factory.ObjectProvider
|
||||
import org.springframework.boot.info.BuildProperties
|
||||
import org.springframework.stereotype.Component
|
||||
import picocli.CommandLine
|
||||
import picocli.CommandLine.Command
|
||||
@@ -22,8 +24,22 @@ import picocli.CommandLine.Command
|
||||
ConfigPrintCommand::class,
|
||||
],
|
||||
mixinStandardHelpOptions = true,
|
||||
versionProvider = BuildPropertiesVersionProvider::class,
|
||||
description = ["Lightweight, declarative CI/CD system"],
|
||||
)
|
||||
class GitTallyCommand : Runnable {
|
||||
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"}")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user