Skip to content

Commit

Permalink
fixed unable to start plugins issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Jun 3, 2022
1 parent 3c34a07 commit 9810aef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion entity/public_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package entity
type PublicPlugin struct {
Id int `json:"id"`
Name string `json:"name"`
ShortName string `json:"short_name"`
FullName string `json:"full_name"`
Description string `json:"description"`
HtmlUrl string `json:"html_url"`
Expand Down
1 change: 1 addition & 0 deletions models/models/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Plugin struct {
Endpoint string `json:"endpoint" bson:"endpoint"`
Cmd string `json:"cmd" bson:"cmd"`
DockerCmd string `json:"docker_cmd" bson:"docker_cmd"`
DockerDir string `json:"docker_dir" bson:"docker_dir"`
EventKey entity.PluginEventKey `json:"event_key" bson:"event_key"`
InstallType string `json:"install_type" bson:"install_type"`
InstallUrl string `json:"install_url" bson:"install_url"`
Expand Down
7 changes: 3 additions & 4 deletions plugin/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func (svc *Service) GetPublicPluginInfo(fullName string) (res interface{}, err e

func (svc *Service) installPublic(p interfaces.Plugin) (err error) {
if utils.IsDocker() {
p.SetInstallUrl(fmt.Sprintf("%s/%s", constants.DefaultSettingPluginBaseUrl, p.GetShortName()))
p.SetInstallUrl(fmt.Sprintf("%s/%s", constants.DefaultSettingPluginBaseUrl, p.GetName()))
return svc.installRemote(p)
} else {
p.SetInstallUrl(fmt.Sprintf("%s/%s", svc.ps.PluginBaseUrl, p.GetFullName()))
Expand Down Expand Up @@ -527,13 +527,12 @@ func (svc *Service) getNewCmdFn(p *models.Plugin, fsSvc interfaces.PluginFsServi
// command
if utils.IsDocker() {
cmd = sys_exec.BuildCmd(p.DockerCmd)
cmd.Dir = p.DockerDir
} else {
cmd = sys_exec.BuildCmd(p.Cmd)
cmd.Dir = fsSvc.GetWorkspacePath()
}

// working directory
cmd.Dir = fsSvc.GetWorkspacePath()

// inherit system envs
for _, env := range os.Environ() {
cmd.Env = append(cmd.Env, env)
Expand Down

0 comments on commit 9810aef

Please sign in to comment.