mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-07 12:50:21 -06:00
* run api tests * run ocis via wrapper * add context, helpers and steps change ocis config * remove separate pipelines for special test cases * add context to behat config * fix suite name * set wrapper url while running tests * fix cors allow env name * address review * add ociswrapper codebase * add ci pipeline to build and cache wrapper * add step to check ociswrapper cache * invalidate wrapper cache and build new * build on pipeline step * undo unnecessary changes * undo unnecessary changes * fix php code * fix ocis run command * use tag for teardown * exclude wrapper vendor in codacy check * fix typos
36 lines
609 B
Go
36 lines
609 B
Go
package wrapper
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
"ociswrapper/common"
|
|
"ociswrapper/ocis/config"
|
|
"ociswrapper/wrapper/handlers"
|
|
)
|
|
|
|
func Start(port string) {
|
|
defer common.Wg.Done()
|
|
|
|
if port == "" {
|
|
port = config.Get("port")
|
|
}
|
|
|
|
httpServer := &http.Server{
|
|
Addr: ":" + port,
|
|
}
|
|
|
|
var mux = http.NewServeMux()
|
|
mux.HandleFunc("/", http.NotFound)
|
|
mux.HandleFunc("/config", handlers.SetEnvHandler)
|
|
mux.HandleFunc("/rollback", handlers.RollbackHandler)
|
|
|
|
httpServer.Handler = mux
|
|
|
|
log.Printf("Starting server on port %s...", port)
|
|
|
|
err := httpServer.ListenAndServe()
|
|
if err != nil {
|
|
log.Panic(err)
|
|
}
|
|
}
|