Propagate the local username

This commit is contained in:
Tom Wilkie
2016-08-17 15:11:04 +01:00
parent e6876d1cec
commit 7acfbd7034
2 changed files with 11 additions and 2 deletions

View File

@@ -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())

View File

@@ -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.