diff --git a/cmd/action/main.go b/cmd/action/main.go index 1b1e0e3acc49bf307cd468b5d0cbde2747215723..0d6873be2a208095dabd3f207178fd13583d8bf3 100644 --- a/cmd/action/main.go +++ b/cmd/action/main.go @@ -6,10 +6,14 @@ import ( "os/signal" "strconv" + log "github.com/Sirupsen/logrus" "github.com/actionscore/actions/pkg/action" + "github.com/actionscore/actions/pkg/version" ) func main() { + log.Infof("Starting Actions Runtime -- version %s -- commit %s", version.Version(), version.Commit()) + mode := flag.String("mode", "standalone", "") actionHTTPPort := flag.String("action-http-port", "3500", "") actionGRPCPort := flag.String("action-grpc-port", "50001", "") diff --git a/cmd/assigner/main.go b/cmd/assigner/main.go index cb19be6a65f468f0f1dde2c726ee9a1595067344..b43c9bb81441bf80ca91b6fd73c4c21546dc2fdd 100644 --- a/cmd/assigner/main.go +++ b/cmd/assigner/main.go @@ -7,9 +7,12 @@ import ( log "github.com/Sirupsen/logrus" "github.com/actionscore/actions/pkg/assigner" + "github.com/actionscore/actions/pkg/version" ) func main() { + log.Infof("Starting Actions Assigner -- version %s -- commit %s", version.Version(), version.Commit()) + port := flag.String("port", "50005", "") flag.Parse() diff --git a/cmd/controller/main.go b/cmd/controller/main.go index 46255127b0dac4de5f3a3a65e7df31b24d54694f..23cf74ad5fe62ee6831d3df4024133b9cdf21fbf 100644 --- a/cmd/controller/main.go +++ b/cmd/controller/main.go @@ -4,14 +4,14 @@ import ( "time" log "github.com/Sirupsen/logrus" - "github.com/golang/glog" "github.com/actionscore/actions/pkg/controller" k8s "github.com/actionscore/actions/pkg/kubernetes" "github.com/actionscore/actions/pkg/signals" + "github.com/actionscore/actions/pkg/version" ) func main() { - log.Info("Starting Actions Controller") + log.Infof("Starting Actions Operator -- version %s -- commit %s", version.Version(), version.Commit()) ctx := signals.Context() kubeClient, actionsClient, err := k8s.Clients() @@ -22,6 +22,6 @@ func main() { controller.NewController(kubeClient, actionsClient).Run(ctx) shutdownDuration := 5 * time.Second - glog.Infof("allowing %s for graceful shutdown to complete", shutdownDuration) + log.Infof("allowing %s for graceful shutdown to complete", shutdownDuration) <-time.After(shutdownDuration) } diff --git a/pkg/version/version.go b/pkg/version/version.go new file mode 100644 index 0000000000000000000000000000000000000000..37d78a019bce124046e5d251a1b23f63c227c276 --- /dev/null +++ b/pkg/version/version.go @@ -0,0 +1,18 @@ +package version + +// Values for these are injected by the build +var ( + version string + commit string +) + +// Version returns the Actions version. This is either a semantic version +// number or else, in the case of unreleased code, the string "devel". +func Version() string { + return version +} + +// Commit returns the git commit SHA for the code that Actions was built from. +func Commit() string { + return commit +}