enable timestamp on image (#556)

* enable timestamp on image

* fix name issue
This commit is contained in:
Minghe
2020-07-09 21:25:55 +08:00
committed by GitHub
parent c17434703e
commit 9e9cdeb3ee
2 changed files with 3 additions and 3 deletions

2
fx.go
View File

@@ -19,7 +19,7 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)
const version = "0.9.44"
const version = "0.9.45"
func init() {
go checkForUpdate()

View File

@@ -44,7 +44,7 @@ func Build(ctx context.Contexter) (err error) {
language := ctx.Get("language").(string)
host := ctx.Get("host").(string)
kubeconf := ctx.Get("kubeconf").(string)
name := ctx.Get("name").(string)
name := fmt.Sprintf("%s-%s", ctx.Get("name").(string), time.Now().Format("20060102150405"))
if err := bundle.Bundle(workdir, language, fn, deps...); err != nil {
return err
@@ -63,7 +63,7 @@ func Build(ctx context.Contexter) (err error) {
if err := docker.BuildImage(ctx.GetContext(), workdir, name); err != nil {
return err
}
nameWithTag := name + ":latest"
nameWithTag := fmt.Sprintf("%s:latest", name)
if err := docker.TagImage(ctx.GetContext(), name, nameWithTag); err != nil {
return err
}