Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit 9810aef

Browse files
committed
fixed unable to start plugins issue
1 parent 3c34a07 commit 9810aef

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

entity/public_plugin.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package entity
33
type PublicPlugin struct {
44
Id int `json:"id"`
55
Name string `json:"name"`
6-
ShortName string `json:"short_name"`
76
FullName string `json:"full_name"`
87
Description string `json:"description"`
98
HtmlUrl string `json:"html_url"`

models/models/plugin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type Plugin struct {
1717
Endpoint string `json:"endpoint" bson:"endpoint"`
1818
Cmd string `json:"cmd" bson:"cmd"`
1919
DockerCmd string `json:"docker_cmd" bson:"docker_cmd"`
20+
DockerDir string `json:"docker_dir" bson:"docker_dir"`
2021
EventKey entity.PluginEventKey `json:"event_key" bson:"event_key"`
2122
InstallType string `json:"install_type" bson:"install_type"`
2223
InstallUrl string `json:"install_url" bson:"install_url"`

plugin/service.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ func (svc *Service) GetPublicPluginInfo(fullName string) (res interface{}, err e
354354

355355
func (svc *Service) installPublic(p interfaces.Plugin) (err error) {
356356
if utils.IsDocker() {
357-
p.SetInstallUrl(fmt.Sprintf("%s/%s", constants.DefaultSettingPluginBaseUrl, p.GetShortName()))
357+
p.SetInstallUrl(fmt.Sprintf("%s/%s", constants.DefaultSettingPluginBaseUrl, p.GetName()))
358358
return svc.installRemote(p)
359359
} else {
360360
p.SetInstallUrl(fmt.Sprintf("%s/%s", svc.ps.PluginBaseUrl, p.GetFullName()))
@@ -527,13 +527,12 @@ func (svc *Service) getNewCmdFn(p *models.Plugin, fsSvc interfaces.PluginFsServi
527527
// command
528528
if utils.IsDocker() {
529529
cmd = sys_exec.BuildCmd(p.DockerCmd)
530+
cmd.Dir = p.DockerDir
530531
} else {
531532
cmd = sys_exec.BuildCmd(p.Cmd)
533+
cmd.Dir = fsSvc.GetWorkspacePath()
532534
}
533535

534-
// working directory
535-
cmd.Dir = fsSvc.GetWorkspacePath()
536-
537536
// inherit system envs
538537
for _, env := range os.Environ() {
539538
cmd.Env = append(cmd.Env, env)

0 commit comments

Comments
 (0)