Improve extensions build. (#12461)

* enable ee build on pr/master

* step1: of including group sync

* disable commit pinning for now

* fixes broken build

* enable team to ldap group sync

* avoid returning error for missing external handler

* services: allow routes to be added before http server start

* services: allows services to add their own migrations

* moves db migrations to ee code base

* build using master branch in ee

* disable enterprise build in .bra.toml

[skip ci]

* removes team sync extensions

* removes commented line
This commit is contained in:
Carl Bergquist
2018-07-01 16:01:43 +02:00
committed by Torkel Ödegaard
parent 1601f6d17c
commit 861af4cb97
17 changed files with 197 additions and 63 deletions

View File

@@ -9,7 +9,14 @@ import (
m "github.com/grafana/grafana/pkg/models"
)
// Register adds http routes
func (hs *HTTPServer) applyRoutes() {
hs.RouteRegister.Register(hs.macaron)
InitAppPluginRoutes(hs.macaron)
hs.macaron.NotFound(NotFoundHandler)
}
func (hs *HTTPServer) registerRoutes() {
macaronR := hs.macaron
reqSignedIn := middleware.Auth(&middleware.AuthOptions{ReqSignedIn: true})
@@ -393,10 +400,4 @@ func (hs *HTTPServer) registerRoutes() {
// streams
//r.Post("/api/streams/push", reqSignedIn, bind(dtos.StreamMessage{}), liveConn.PushToStream)
r.Register(macaronR)
InitAppPluginRoutes(macaronR)
macaronR.NotFound(NotFoundHandler)
}

View File

@@ -132,6 +132,7 @@ func getFrontendSettingsMap(c *m.ReqContext) (map[string]interface{}, error) {
}
jsonObj := map[string]interface{}{
"enterprise": setting.Enterprise,
"defaultDatasource": defaultDatasource,
"datasources": datasources,
"panels": panels,

View File

@@ -33,7 +33,11 @@ import (
)
func init() {
registry.RegisterService(&HTTPServer{})
registry.Register(&registry.Descriptor{
Name: "HTTPServer",
Instance: &HTTPServer{},
InitPriority: registry.High,
})
}
type HTTPServer struct {
@@ -54,6 +58,10 @@ func (hs *HTTPServer) Init() error {
hs.log = log.New("http.server")
hs.cache = gocache.New(5*time.Minute, 10*time.Minute)
hs.streamManager = live.NewStreamManager()
hs.macaron = hs.newMacaron()
hs.registerRoutes()
return nil
}
@@ -61,10 +69,7 @@ func (hs *HTTPServer) Run(ctx context.Context) error {
var err error
hs.context = ctx
hs.streamManager = live.NewStreamManager()
hs.macaron = hs.newMacaron()
hs.registerRoutes()
hs.applyRoutes()
hs.streamManager.Run(ctx)
listenAddr := fmt.Sprintf("%s:%s", setting.HttpAddr, setting.HttpPort)