diff --git a/cmd/openqa-mon/openqa-mon.go b/cmd/openqa-mon/openqa-mon.go index e525db9..8e3a573 100644 --- a/cmd/openqa-mon/openqa-mon.go +++ b/cmd/openqa-mon/openqa-mon.go @@ -15,10 +15,9 @@ import ( "unicode" "github.com/grisu48/gopenqa" + "github.com/grisu48/openqa-mon/internal" ) -const VERSION = "1.2.1" - var config Config var tui TUI @@ -529,7 +528,7 @@ func parseProgramArguments(cliargs []string) error { printHelp() os.Exit(0) case "--version": - fmt.Println("openqa-mon version " + VERSION) + fmt.Println("openqa-mon version " + internal.VERSION) os.Exit(0) case "--jobs": i++ @@ -736,7 +735,7 @@ func main() { if len(remotes) == 1 { remotesString = remotes[0].URI } - tui.SetHeader(fmt.Sprintf("openqa-mon v%s - Monitoring %s", VERSION, remotesString)) + tui.SetHeader(fmt.Sprintf("openqa-mon v%s - Monitoring %s", internal.VERSION, remotesString)) tui.Model.HideStates = config.HideStates tui.Update() defer tui.LeaveAltScreen() diff --git a/cmd/openqa-mq/openqa-mq.go b/cmd/openqa-mq/openqa-mq.go index 3bfb0be..4058af5 100644 --- a/cmd/openqa-mq/openqa-mq.go +++ b/cmd/openqa-mq/openqa-mq.go @@ -7,11 +7,10 @@ import ( "strings" "syscall" + "github.com/grisu48/openqa-mon/internal" amqp "github.com/rabbitmq/amqp091-go" ) -const VERSION = "1.2.1" - type Config struct { Remote string // Remote address Keys []string // Keys or "topics" @@ -86,7 +85,7 @@ func parseProgramArguments() error { printUsage() os.Exit(0) } else if arg == "--version" { - fmt.Println("openqa-mq version " + VERSION) + fmt.Println("openqa-mq version " + internal.VERSION) os.Exit(0) } else if arg == "-r" { if i >= len(args)-1 { diff --git a/cmd/openqa-revtui/openqa-revtui.go b/cmd/openqa-revtui/openqa-revtui.go index a85f70e..584ef47 100644 --- a/cmd/openqa-revtui/openqa-revtui.go +++ b/cmd/openqa-revtui/openqa-revtui.go @@ -9,10 +9,9 @@ import ( "github.com/BurntSushi/toml" "github.com/grisu48/gopenqa" + "github.com/grisu48/openqa-mon/internal" ) -const VERSION = "1.2.1" - /* Group is a single configurable monitoring unit. A group contains all parameters that will be queried from openQA */ type Group struct { Name string @@ -312,7 +311,7 @@ func parseProgramArgs() error { printUsage() os.Exit(0) } else if arg == "--version" { - fmt.Println("openqa-revtui version " + VERSION) + fmt.Println("openqa-revtui version " + internal.VERSION) os.Exit(0) } else if arg == "-c" || arg == "--config" { if i++; i >= n { @@ -538,7 +537,7 @@ func browserJobs(jobs []gopenqa.Job) error { // main routine for the TUI instance func tui_main(tui *TUI, instance *gopenqa.Instance) error { - title := "openqa Review TUI Dashboard v" + VERSION + title := "openqa Review TUI Dashboard v" + internal.VERSION var rabbitmq gopenqa.RabbitMQ var err error diff --git a/internal/main.go b/internal/main.go new file mode 100644 index 0000000..efe36de --- /dev/null +++ b/internal/main.go @@ -0,0 +1,5 @@ +// shared modules between the different openqa-mon applications +package internal + +// VERSION gives the unified version string for all application +const VERSION = "1.2.2"