feat(controller): intial build functions setup in go and service building
This commit is contained in:
26
controller/build_v2app.go
Normal file
26
controller/build_v2app.go
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user