2019-10-29 20:54:47 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-11-02 14:32:58 +00:00
|
|
|
log "github.com/sirupsen/logrus"
|
2019-10-29 20:54:47 +00:00
|
|
|
"github.com/spf13/cobra"
|
2020-04-05 12:37:21 +00:00
|
|
|
|
2021-08-11 01:04:35 +00:00
|
|
|
"github.com/authelia/authelia/v4/internal/utils"
|
2019-10-29 20:54:47 +00:00
|
|
|
)
|
|
|
|
|
2020-05-02 05:06:39 +00:00
|
|
|
// RunCI run the CI scripts.
|
2019-10-29 20:54:47 +00:00
|
|
|
func RunCI(cmd *cobra.Command, args []string) {
|
2019-11-30 16:49:52 +00:00
|
|
|
log.Info("=====> Build stage <=====")
|
2020-05-05 19:35:32 +00:00
|
|
|
|
2021-06-25 11:53:20 +00:00
|
|
|
buildkite, _ := cmd.Flags().GetBool("buildkite")
|
|
|
|
if buildkite {
|
|
|
|
if err := utils.CommandWithStdout("authelia-scripts", "--log-level", "debug", "--buildkite", "build").Run(); err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if err := utils.CommandWithStdout("authelia-scripts", "--log-level", "debug", "build").Run(); err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
2019-10-29 20:54:47 +00:00
|
|
|
}
|
|
|
|
|
2019-11-30 16:49:52 +00:00
|
|
|
log.Info("=====> Unit testing stage <=====")
|
2020-05-05 19:35:32 +00:00
|
|
|
|
2019-11-02 14:32:58 +00:00
|
|
|
if err := utils.CommandWithStdout("authelia-scripts", "--log-level", "debug", "unittest").Run(); err != nil {
|
|
|
|
log.Fatal(err)
|
2019-10-29 20:54:47 +00:00
|
|
|
}
|
|
|
|
}
|