mirror of
https://github.com/Graylog2/graylog-project-cli.git
synced 2026-03-13 08:02:57 +08:00
Add ansi color to release output when running on Jenkins (#26)
Co-authored-by: Bernd Ahlers <bernd@graylog.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package apply
|
||||
|
||||
import (
|
||||
"github.com/Graylog2/graylog-project-cli/project"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -13,6 +14,11 @@ type CommonMaven struct {
|
||||
func (common CommonMaven) MavenRunWithProfiles(profiles []string, args ...string) {
|
||||
commands := []string{"mvn --show-version --batch-mode --fail-fast"}
|
||||
|
||||
// Force maven color output when executed on Jenkins to prettify the logs
|
||||
if os.Getenv("BUILD_ID") != "" {
|
||||
commands = append(commands, "-Dstyle.color=always")
|
||||
}
|
||||
|
||||
if len(profiles) > 0 {
|
||||
commands = append(commands, "--activate-profiles")
|
||||
commands = append(commands, strings.Join(profiles, ","))
|
||||
|
||||
Reference in New Issue
Block a user