diff --git a/magefiles/mage.go b/magefiles/mage.go index 25a360f..7b33d7f 100644 --- a/magefiles/mage.go +++ b/magefiles/mage.go @@ -7,6 +7,7 @@ import ( "os" "github.com/magefile/mage/sh" + "github.com/magefile/mage/mg" ) const ( @@ -40,13 +41,23 @@ func Clean() error { // Render renders the template files. func Render(name string) error { + if name == "forgejo" { + mg.Deps(DownloadForgejo) + } + cfg, err := newConfig(configFile) if err != nil { return fmt.Errorf("unable to load the configuration; %v", err) } + if name != "compose" { + if err := render(cfg, "compose"); err != nil { + return fmt.Errorf("an error occurred whilst rendering the compose file; %w", err) + } + } + if err := render(cfg, name); err != nil { - return fmt.Errorf("an error occurred whilst rendering the templates; %v", err) + return fmt.Errorf("an error occurred whilst rendering the templates; %w", err) } return nil @@ -56,7 +67,7 @@ func Render(name string) error { func Deploy(name string) error { cfg, err := newConfig(configFile) if err != nil { - return fmt.Errorf("unable to load the configuration; %v", err) + return fmt.Errorf("unable to load the configuration; %w", err) } os.Setenv("DOCKER_HOST", cfg.DockerHost)