with main.go path

This commit is contained in:
Kasper Juul Hermansen 2022-10-29 23:27:43 +02:00
parent c4ca5f25a0
commit 0838bc5a56
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23

View File

@ -10,7 +10,8 @@ import (
func Build() *cobra.Command {
var (
imageTag string
imageTag string
mainGoPath string
)
cmd := &cobra.Command{
@ -30,12 +31,14 @@ func Build() *cobra.Command {
}
defer client.CleanUp()
return tasks.Build(client, imageTag, "main.go")
return tasks.Build(client, imageTag, mainGoPath)
},
}
cmd.PersistentFlags().StringVar(&imageTag, "image-tag", "", "the url for which to tag the docker image, defaults to private url, with repo as image name")
cmd.MarkPersistentFlagRequired("image-tag")
cmd.PersistentFlags().StringVar(&mainGoPath, "main-path", "main.go", "main.go path")
return cmd
}