Skip to content

Commit

Permalink
Clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
denismakogon committed Sep 9, 2018
1 parent 2a3ba0c commit dd16537
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
11 changes: 5 additions & 6 deletions commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,17 @@ func (b *buildcmd) build(c *cli.Context) error {
return err
}

buildArgs := c.StringSlice("build-arg")
verbose := c.GlobalBool("verbose")

switch common.GetFuncYamlVersion(ffV) {
case common.LatestYamlVersion:
fpath, ff, err := common.FindAndParseFuncFileV20180708(dir)
if err != nil {
return err
}

buildArgs := c.StringSlice("build-arg")
ff, err = common.BuildFuncV20180708(buildArgs, c.GlobalBool("verbose"), b.noCache, fpath, ff)
ff, err = common.BuildFuncV20180708(buildArgs, verbose, b.noCache, fpath, ff)
if err != nil {
return err
}
Expand All @@ -96,10 +98,7 @@ func (b *buildcmd) build(c *cli.Context) error {
return err
}

buildArgs := c.StringSlice("build-arg")
verbpse := c.GlobalBool("verbose")

ff, err = common.BuildFunc(buildArgs, verbpse, b.noCache, fpath, ff)
ff, err = common.BuildFunc(buildArgs, verbose, b.noCache, fpath, ff)
if err != nil {
return err
}
Expand Down
8 changes: 0 additions & 8 deletions commands/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,6 @@ func (p *deploycmd) deploy(c *cli.Context) error {
return p.deploySingle(c, deployConfig, appName, appf)
}

type DeployConfig struct {
BuildArgs []string
Verbose bool
NoBump bool
IsLocal bool
NoCache bool
}

// deploySingle deploys a single function, either the current directory or if in the context
// of an app and user provides relative path as the first arg, it will deploy that function.
func (p *deploycmd) deploySingle(c *cli.Context, deployConfig *DeployConfig, appName string, appf *common.AppFile) error {
Expand Down
8 changes: 8 additions & 0 deletions commands/deploy_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ import (
v2Client "github.com/fnproject/fn_go/clientv2"
)

type DeployConfig struct {
BuildArgs []string
Verbose bool
NoBump bool
IsLocal bool
NoCache bool
}

func DeploySingle(clientV1 *fnclient.Fn, clientV2 *v2Client.Fn, deployConfig *DeployConfig, dir, appName string, appf *common.AppFile) error {
wd := common.GetWd()

Expand Down

0 comments on commit dd16537

Please sign in to comment.