initial Spring app

This commit is contained in:
Michael Hoennig
2026-06-09 11:55:23 +02:00
parent 18b0b3e537
commit b47489ab2b
19 changed files with 570 additions and 1 deletions
@@ -0,0 +1,22 @@
package de.hoennig.gittally
import org.springframework.boot.CommandLineRunner
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import picocli.CommandLine
import picocli.CommandLine.IFactory
import kotlin.system.exitProcess
@SpringBootApplication
class GitTallyApplication(
private val factory: IFactory,
private val rootCommand: GitTallyCommand,
) : CommandLineRunner {
override fun run(vararg args: String) {
exitProcess(CommandLine(rootCommand, factory).execute(*args))
}
}
fun main(args: Array<String>) {
runApplication<GitTallyApplication>(*args)
}
@@ -0,0 +1,21 @@
package de.hoennig.gittally
import de.hoennig.gittally.commands.ConfigPrintCommand
import de.hoennig.gittally.commands.InitCommand
import de.hoennig.gittally.commands.ServerCommand
import org.springframework.stereotype.Component
import picocli.CommandLine
import picocli.CommandLine.Command
@Component
@Command(
name = "gittally",
subcommands = [InitCommand::class, ServerCommand::class, ConfigPrintCommand::class],
mixinStandardHelpOptions = true,
description = ["Lightweight, declarative CI/CD system"],
)
class GitTallyCommand : Runnable {
override fun run() {
throw CommandLine.ParameterException(CommandLine(this), "Specify a subcommand")
}
}
@@ -0,0 +1,21 @@
package de.hoennig.gittally.commands
import org.springframework.stereotype.Component
import picocli.CommandLine.Command
import picocli.CommandLine.Option
@Component
@Command(
name = "config:print",
description = ["Print the effective configuration"],
mixinStandardHelpOptions = true,
)
class ConfigPrintCommand : Runnable {
@Option(names = ["--full"], description = ["Include all defaults"])
var full: Boolean = false
override fun run() {
println("config:print${if (full) " --full" else ""} not yet implemented")
}
}
@@ -0,0 +1,16 @@
package de.hoennig.gittally.commands
import org.springframework.stereotype.Component
import picocli.CommandLine.Command
@Component
@Command(
name = "init",
description = ["Initialize GitTally for the current repository"],
mixinStandardHelpOptions = true,
)
class InitCommand : Runnable {
override fun run() {
println("init not yet implemented")
}
}
@@ -0,0 +1,16 @@
package de.hoennig.gittally.commands
import org.springframework.stereotype.Component
import picocli.CommandLine.Command
@Component
@Command(
name = "server",
description = ["Start the GitTally server"],
mixinStandardHelpOptions = true,
)
class ServerCommand : Runnable {
override fun run() {
println("server not yet implemented")
}
}