add tool to gitea
Build and Deploy / build-and-deploy (push) Failing after 20s

This commit is contained in:
2026-06-05 02:34:00 +10:00
commit 532b912ffb
25 changed files with 4981 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
package cmd
import (
"fmt"
"os"
"kforge/internal/config"
"github.com/spf13/cobra"
)
var cfgFile string
var rootCmd = &cobra.Command{
Use: "kforge",
Short: "kforge — Kubernetes manifest generator for your homelab",
Long: `kforge reads a kforge.yml file and generates flat Kubernetes
manifests for each environment. It handles namespacing, TLS,
ingress, infrastructure (CNPG, Valkey, NATS, Minio, Meilisearch),
cron jobs, and DNS record creation via Cloudflare.
Get started:
kforge validate Check your kforge.yml and secrets
kforge generate Generate manifests for all environments
kforge generate --env production --dry-run
kforge secrets list Show required secrets checklist`,
}
func init() {
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "kforge.yml",
"Path to kforge.yml")
}
// Execute runs the root command. Called from main().
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
// loadConfig is a shared helper used by all subcommands.
func loadConfig() (*config.KforgeConfig, error) {
cfg, err := config.Load(cfgFile)
if err != nil {
return nil, fmt.Errorf("loading %s: %w", cfgFile, err)
}
return cfg, nil
}