Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Commit

Permalink
Propagate the local username
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwilkie committed Aug 17, 2016
1 parent e6876d1 commit 7acfbd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/wcloud/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io/ioutil"
"os"
"os/user"
"path/filepath"
"strings"
"time"
Expand Down Expand Up @@ -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())
Expand Down
2 changes: 2 additions & 0 deletions cmd/wcloud/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7acfbd7

Please sign in to comment.