File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,7 @@ func (App) LsApp(ctx *gin.Context) {
318
318
type checkBundleReq struct {
319
319
AppName * string `json:"appName" binding:"required"`
320
320
Deployment * string `json:"deployment" binding:"required"`
321
+ Version * string `json:"version" binding:"required"`
321
322
}
322
323
323
324
func (App ) CheckBundle (ctx * gin.Context ) {
@@ -333,10 +334,19 @@ func (App) CheckBundle(ctx *gin.Context) {
333
334
if deployment == nil {
334
335
log .Panic ("Deployment " + * checkBundleReq .Deployment + " not found" )
335
336
}
337
+ var hash * string
338
+ if deployment .VersionId != nil {
339
+ deployment := model.DeploymentVersion {}.GetByKeyDeploymentIdAndVersion (* deployment .Id , * checkBundleReq .Version )
340
+ if deployment != nil {
341
+ pack := model .GetOne [model.Package ]("id" , deployment .CurrentPackage )
342
+ hash = pack .Hash
343
+ }
344
+ }
336
345
337
346
ctx .JSON (http .StatusOK , gin.H {
338
347
"appName" : app .AppName ,
339
348
"os" : app .OS ,
349
+ "hash" : hash ,
340
350
})
341
351
} else {
342
352
log .Panic (err .Error ())
You can’t perform that action at this time.
0 commit comments