diff --git a/cmd/wcloud/cli.go b/cmd/wcloud/cli.go index cd11bd30f1..9cf3080ddc 100644 --- a/cmd/wcloud/cli.go +++ b/cmd/wcloud/cli.go @@ -7,6 +7,7 @@ import ( "fmt" "io/ioutil" "os" + "os/user" "path/filepath" "strings" "time" @@ -71,9 +72,15 @@ func deploy(c Client, args []string) { usage() return } + user, err := user.Current() + if err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } deployment := Deployment{ - ImageName: parts[0], - Version: parts[1], + ImageName: parts[0], + Version: parts[1], + TriggeringUser: user.Username, } if err := c.Deploy(deployment); err != nil { fmt.Println(err.Error()) diff --git a/cmd/wcloud/types.go b/cmd/wcloud/types.go index 74fec5eeb7..2b30f25dff 100644 --- a/cmd/wcloud/types.go +++ b/cmd/wcloud/types.go @@ -12,6 +12,8 @@ type Deployment struct { Version string `json:"version"` Priority int `json:"priority"` State string `json:"status"` + + TriggeringUser string `json:"triggering_user"` } // Config for the deployment system for a user.