Can show repository logs in admin interface
Some checks are pending
continuous-integration/drone/push Build is running

This commit is contained in:
nemunaire 2022-09-16 12:03:50 +02:00
commit 5b3bdb0429
3 changed files with 44 additions and 6 deletions

View file

@ -222,6 +222,7 @@ func declareAPIAuthRepositoriesRoutes(router *gin.RouterGroup) {
client := drone.NewClient(droneEndpoint, droneConfig)
result, err := client.Logs(tmp[0], tmp[1], nbuild, 1, 3)
if err != nil {
log.Printf("An error occurs when retrieving logs from Drone (%s/%s/%d/1/3): %s", tmp[0], tmp[1], nbuild, err.Error())
c.AbortWithStatusJSON(http.StatusNotFound, gin.H{"errmsg": "Unable to retrieve logs."})
return
}