Teach fn build --no-cache to avoid using cached steps

This commit is contained in:
Will Price
2017-07-20 09:54:14 -07:00
committed by James Jeffrey
parent 0b736b4b1c
commit c734efefce
3 changed files with 25 additions and 7 deletions

View File

@@ -39,6 +39,7 @@ type deploycmd struct {
verbose bool
incremental bool
skippush bool
noCache bool
verbwriter io.Writer
}
@@ -62,6 +63,11 @@ func (p *deploycmd) flags() []cli.Flag {
Usage: "uses incremental building",
Destination: &p.incremental,
},
cli.BoolFlag{
Name: "no-cache",
Usage: "Don't use Docker cache for the build",
Destination: &p.noCache,
},
cli.BoolFlag{
Name: "skip-push",
Usage: "does not push Docker built images onto Docker Hub - useful for local development.",
@@ -126,7 +132,7 @@ func (p *deploycmd) deploy(c *cli.Context, funcFilePath string) error {
return err
}
funcfile, err := buildfunc(p.verbwriter, funcFileName)
funcfile, err := buildfunc(p.verbwriter, funcFileName, p.noCache)
if err != nil {
return err
}