feat(controller): intial build functions setup in go and service building

This commit is contained in:
2025-09-05 09:14:34 -05:00
parent 8a07c8afe4
commit 87aafef350
13 changed files with 510 additions and 8 deletions

26
controller/build_v2app.go Normal file
View File

@@ -0,0 +1,26 @@
package main
import (
"os"
"os/exec"
"path/filepath"
)
// ---- Run npm build ----
func runNpmV2Build() error {
cmd := exec.Command("npm", "run", "newBuild")
if os.Getenv("RUNNING_IN_DOCKER") == "true" {
cmd.Dir = "/app"
}else {
// Go three directories up from the current working directory
cwd, err := os.Getwd()
if err != nil {
return err
}
dir := filepath.Join(cwd, "..", "..", "lstV2")
cmd.Dir = dir
}
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}