Browse Source

fix: 解决 nexus 安装失败的问题 (#1189)

Refs https://github.com/1Panel-dev/1Panel/issues/1179
pull/1190/head
zhengkunwang223 2 years ago committed by GitHub
parent
commit
ce0342e235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      backend/app/service/app.go
  2. 3
      backend/app/service/app_install.go

6
backend/app/service/app.go

@ -335,9 +335,6 @@ func (a AppService) Install(ctx context.Context, req request.AppInstallCreate) (
if err = createLink(ctx, app, appInstall, req.Params); err != nil { if err = createLink(ctx, app, appInstall, req.Params); err != nil {
return return
} }
if err = upAppPre(app, appInstall); err != nil {
return
}
go func() { go func() {
if err = copyData(app, appDetail, appInstall, req); err != nil { if err = copyData(app, appDetail, appInstall, req); err != nil {
if appInstall.Status == constant.Installing { if appInstall.Status == constant.Installing {
@ -347,6 +344,9 @@ func (a AppService) Install(ctx context.Context, req request.AppInstallCreate) (
_ = appInstallRepo.Save(context.Background(), appInstall) _ = appInstallRepo.Save(context.Background(), appInstall)
return return
} }
if err = upAppPre(app, appInstall); err != nil {
return
}
go func() { go func() {
_, _ = http.Get(appDetail.DownloadCallBackUrl) _, _ = http.Get(appDetail.DownloadCallBackUrl)
}() }()

3
backend/app/service/app_install.go

@ -257,6 +257,9 @@ func (a *AppInstallService) Update(req request.AppInstalledUpdate) error {
backupDockerCompose := installed.DockerCompose backupDockerCompose := installed.DockerCompose
if req.Advanced { if req.Advanced {
composeMap := make(map[string]interface{}) composeMap := make(map[string]interface{})
if err = yaml.Unmarshal([]byte(installed.DockerCompose), &composeMap); err != nil {
return err
}
if err := addDockerComposeCommonParam(composeMap, installed.ServiceName, req.AppContainerConfig, req.Params); err != nil { if err := addDockerComposeCommonParam(composeMap, installed.ServiceName, req.AppContainerConfig, req.Params); err != nil {
return err return err
} }

Loading…
Cancel
Save