Build with Magefile #104341

Merged
Sybren A. Stüvel merged 26 commits from magefile into main 2024-10-04 21:59:46 +02:00
Showing only changes of commit 350c4f3686 - Show all commits

View File

@ -10,6 +10,7 @@ import (
"github.com/magefile/mage/mg" "github.com/magefile/mage/mg"
"github.com/magefile/mage/sh" "github.com/magefile/mage/sh"
"github.com/magefile/mage/target"
) )
const ( const (
@ -52,6 +53,13 @@ func FlamencoWorker() error {
// Build the webapp as static files that can be served // Build the webapp as static files that can be served
func WebappStatic() error { func WebappStatic() error {
runInstall, err := target.Dir("web/app/node_modules")
if err != nil {
return err
}
if runInstall {
mg.SerialDeps(WebappInstallDeps)
}
if err := cleanWebappStatic(); err != nil { if err := cleanWebappStatic(); err != nil {
return err return err
} }
@ -63,7 +71,7 @@ func WebappStatic() error {
// When changing the base URL, also update the line // When changing the base URL, also update the line
// e.GET("/app/*", echo.WrapHandler(webAppHandler)) // e.GET("/app/*", echo.WrapHandler(webAppHandler))
// in `cmd/flamenco-manager/main.go` // in `cmd/flamenco-manager/main.go`
err := sh.RunWithV(env, err = sh.RunWithV(env,
"yarn", "yarn",
"--cwd", "web/app", "--cwd", "web/app",
"build", "build",