Skip to content

Commit

Permalink
added release_version tag and fixed version tag (#53)
Browse files Browse the repository at this point in the history
* added cdflow_version tag and fixed version tag

* fixed missing colon in tag

* swap cdflow version with Relase Version

* fixed release release_version  tag
  • Loading branch information
marciogoda authored Dec 8, 2023
1 parent 454dea9 commit a03f396
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func runCommand() (status int) {
usage("release")
return 2
}

state.MonitoringClient.ReleaseVersion = releaseArgs.Version
if err := release.RunCommand(state, *releaseArgs, env); err != nil {
if status, ok := err.(command.Failure); ok {
return int(status)
Expand All @@ -248,6 +248,7 @@ func runCommand() (status int) {
}

state.MonitoringClient.Environment = deployArgs.EnvName
state.MonitoringClient.ReleaseVersion = deployArgs.Version

if err := deploy.RunCommand(state, deployArgs, env); err != nil {
if status, ok := err.(command.Failure); ok {
Expand All @@ -265,6 +266,7 @@ func runCommand() (status int) {
}

state.MonitoringClient.Environment = shellArgs.EnvName
state.MonitoringClient.ReleaseVersion = shellArgs.Version

if err := shell.RunCommand(state, shellArgs, env); err != nil {
if status, ok := err.(command.Failure); ok {
Expand Down Expand Up @@ -297,6 +299,7 @@ func runCommand() (status int) {
}

state.MonitoringClient.Environment = destroyArgs.EnvName
state.MonitoringClient.ReleaseVersion = destroyArgs.Version

if err := destroy.RunCommand(state, destroyArgs, env); err != nil {
if status, ok := err.(command.Failure); ok {
Expand Down
16 changes: 9 additions & 7 deletions monitoring/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ import (
)

type DatadogClient struct {
APIKey string
Command string
Environment string
ConfigData map[string]string
Project string
StatusCode int
Version string
APIKey string
Command string
Environment string
ConfigData map[string]string
Project string
StatusCode int
Version string
ReleaseVersion string
}

func NewDatadogClient() *DatadogClient {
Expand Down Expand Up @@ -76,6 +77,7 @@ func (m *DatadogClient) collectTags() []string {
tags := []string{
"command:" + m.Command,
"version:" + m.Version,
"release_version:" + m.ReleaseVersion,
"status_code:" + strconv.Itoa(m.StatusCode),
}

Expand Down

0 comments on commit a03f396

Please sign in to comment.