✨ Support set environment for process manager
All checks were successful
release-nightly / build-docker (push) Successful in 1m10s
All checks were successful
release-nightly / build-docker (push) Successful in 1m10s
This commit is contained in:
parent
47bc1c6aa1
commit
4942a8b7a2
@ -8,11 +8,12 @@ import (
|
||||
)
|
||||
|
||||
type ProcessConfig struct {
|
||||
ID string `json:"id" yaml:"id"`
|
||||
Workdir string `json:"workdir" yaml:"workdir"`
|
||||
Command []string `json:"command" yaml:"command"`
|
||||
Prepares [][]string `json:"prepares" yaml:"prepares"`
|
||||
Preheat bool `json:"preheat" yaml:"preheat"`
|
||||
ID string `json:"id" yaml:"id"`
|
||||
Workdir string `json:"workdir" yaml:"workdir"`
|
||||
Command []string `json:"command" yaml:"command"`
|
||||
Environment []string `json:"environment" yaml:"environment"`
|
||||
Prepares [][]string `json:"prepares" yaml:"prepares"`
|
||||
Preheat bool `json:"preheat" yaml:"preheat"`
|
||||
|
||||
Cmd *exec.Cmd `json:"-"`
|
||||
}
|
||||
@ -63,6 +64,7 @@ func (v *ProcessConfig) StartProcess() error {
|
||||
|
||||
v.Cmd = exec.Command(v.Command[0], v.Command[1:]...)
|
||||
v.Cmd.Dir = filepath.Join(v.Workdir)
|
||||
v.Cmd.Env = append(v.Cmd.Env, v.Environment...)
|
||||
|
||||
return v.Cmd.Start()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user