2019-11-02 14:32:58 +00:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
var traefikSuiteName = "Traefik"
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
dockerEnvironment := NewDockerEnvironment([]string{
|
|
|
|
"docker-compose.yml",
|
2019-11-24 20:27:59 +00:00
|
|
|
"internal/suites/Traefik/docker-compose.yml",
|
2019-11-02 14:32:58 +00:00
|
|
|
"example/compose/authelia/docker-compose.backend.yml",
|
|
|
|
"example/compose/authelia/docker-compose.frontend.yml",
|
|
|
|
"example/compose/nginx/backend/docker-compose.yml",
|
|
|
|
"example/compose/traefik/docker-compose.yml",
|
|
|
|
"example/compose/smtp/docker-compose.yml",
|
|
|
|
})
|
|
|
|
|
|
|
|
setup := func(suitePath string) error {
|
2019-11-24 20:27:59 +00:00
|
|
|
err := dockerEnvironment.Up()
|
2019-11-02 14:32:58 +00:00
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return waitUntilAutheliaIsReady(dockerEnvironment)
|
|
|
|
}
|
|
|
|
|
|
|
|
teardown := func(suitePath string) error {
|
2019-11-24 20:27:59 +00:00
|
|
|
err := dockerEnvironment.Down()
|
2019-11-02 14:32:58 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
GlobalRegistry.Register(traefikSuiteName, Suite{
|
|
|
|
SetUp: setup,
|
|
|
|
SetUpTimeout: 5 * time.Minute,
|
|
|
|
TearDown: teardown,
|
|
|
|
TearDownTimeout: 2 * time.Minute,
|
|
|
|
})
|
|
|
|
}
|