Files
opencloud/tests/ociswrapper/wrapper/wrapper.go
Sawjan Gurung 9945dad647 [POC][full-ci] Testing various oCIS env configurations (#6062)
* 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
2023-05-11 17:21:52 +05:45

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)
}
}