2026-04-17 18:11:18 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"danicos.dev/daniel/homelab/pkg/root"
|
|
|
|
|
"danicos.dev/daniel/homelab/pkg/target"
|
|
|
|
|
// "github.com/magefile/mage/mg" // mg contains helpful utility functions, like Deps
|
|
|
|
|
/*
|
|
|
|
|
NOTE: Mage https://github.com/magefile/mage
|
|
|
|
|
Mage other packages
|
|
|
|
|
"github.com/magefile/mage/mage"
|
|
|
|
|
"github.com/magefile/mage/parse"
|
|
|
|
|
"github.com/magefile/mage/target"
|
|
|
|
|
*/)
|
|
|
|
|
|
|
|
|
|
var r target.Runner
|
2026-04-17 20:49:37 -04:00
|
|
|
var Default = Build
|
2026-04-17 18:11:18 -04:00
|
|
|
var Aliases = map[string]any{
|
2026-04-17 20:49:37 -04:00
|
|
|
"b": Build,
|
2026-04-17 18:11:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
Env := map[string]string{
|
|
|
|
|
"LINUX_ADMIN": "arch",
|
|
|
|
|
"CLUSTER_NAME": root.HYDRA_CLUSTER,
|
|
|
|
|
"CLUSTER_HOST": root.HYDRA_HOSTNAME,
|
|
|
|
|
"GITEA_HOST": root.GITEA_HOST,
|
|
|
|
|
}
|
|
|
|
|
r = target.NewRunner(Env, nil)
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-17 20:49:37 -04:00
|
|
|
func Build() error {
|
2026-04-17 18:11:18 -04:00
|
|
|
t := target.NewA("go", "run", ".")
|
|
|
|
|
return r.RunV("run", t)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func InstallK3S() error {
|
|
|
|
|
t := target.New("./scripts/install_k3s.sh")
|
|
|
|
|
return r.RunV("Install k3s", t)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetKubeconfig() error {
|
|
|
|
|
t := target.New("./scripts/get_kubeconfig.sh")
|
|
|
|
|
return r.RunV("Get Kubeconfig", t)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func InstallFlux() error {
|
|
|
|
|
t := target.New("./scripts/install_flux.sh")
|
|
|
|
|
return r.RunV("Install Flux", t)
|
|
|
|
|
}
|