Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cli/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cmd

import (
"context"
"os"
"strings"

"github.com/elastic/e2e-testing/cli/config"
Expand Down Expand Up @@ -78,7 +79,11 @@ func buildRunProfileCommand(key string, profile config.Profile) *cobra.Command {
return &cobra.Command{
Use: key,
Short: `Runs the ` + profile.Name + ` profile`,
Long: `Runs the ` + profile.Name + ` profile, spinning up the Services that compound it`,
Long: `Runs the ` + profile.Name + ` profile, spinning up the Services that compound it

Example:
go run main.go run profile fleet -s elastic-agent:8.0.0-SNAPSHOT
`,
Run: func(cmd *cobra.Command, args []string) {
serviceManager := services.NewServiceManager()

Expand All @@ -99,6 +104,13 @@ func buildRunProfileCommand(key string, profile config.Profile) *cobra.Command {

for _, srv := range services {
arr := strings.Split(srv, ":")
if len(arr) != 2 {
log.WithFields(log.Fields{
"profile": key,
"services": servicesToRun,
}).Error("Unable to determine the <image>:<tag>, please make sure to use a known docker tag format, eg. `elastic-agent:8.0.0-SNAPSHOT`")
os.Exit(1)
}
image := arr[0]
tag := arr[1]

Expand Down