2019-10-30 03:54:47 +07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-11-02 21:32:58 +07:00
|
|
|
"github.com/clems4ever/authelia/utils"
|
|
|
|
log "github.com/sirupsen/logrus"
|
2019-10-30 03:54:47 +07:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
const dockerPullCommandLine = "docker-compose -f docker-compose.yml " +
|
2019-11-16 17:38:21 +07:00
|
|
|
"-f example/compose/mariadb/docker-compose.yml " +
|
2019-10-30 03:54:47 +07:00
|
|
|
"-f example/compose/redis/docker-compose.yml " +
|
|
|
|
"-f example/compose/nginx/portal/docker-compose.yml " +
|
|
|
|
"-f example/compose/smtp/docker-compose.yml " +
|
|
|
|
"-f example/compose/httpbin/docker-compose.yml " +
|
|
|
|
"-f example/compose/ldap/docker-compose.admin.yml " +
|
|
|
|
"-f example/compose/ldap/docker-compose.yml " +
|
|
|
|
"pull"
|
|
|
|
|
|
|
|
// RunCI run the CI scripts
|
|
|
|
func RunCI(cmd *cobra.Command, args []string) {
|
2019-11-02 21:32:58 +07:00
|
|
|
log.Info("=====> Build stage")
|
|
|
|
if err := utils.CommandWithStdout("authelia-scripts", "--log-level", "debug", "build").Run(); err != nil {
|
|
|
|
log.Fatal(err)
|
2019-10-30 03:54:47 +07:00
|
|
|
}
|
|
|
|
|
2019-11-02 21:32:58 +07:00
|
|
|
log.Info("=====> Unit testing stage")
|
|
|
|
if err := utils.CommandWithStdout("authelia-scripts", "--log-level", "debug", "unittest").Run(); err != nil {
|
|
|
|
log.Fatal(err)
|
2019-10-30 03:54:47 +07:00
|
|
|
}
|
|
|
|
|
2019-11-02 21:32:58 +07:00
|
|
|
log.Info("=====> End-to-end testing stage")
|
|
|
|
if err := utils.CommandWithStdout("authelia-scripts", "--log-level", "debug", "suites", "test", "--headless", "--only-forbidden").Run(); err != nil {
|
|
|
|
log.Fatal(err)
|
2019-10-30 03:54:47 +07:00
|
|
|
}
|
|
|
|
}
|