mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 01:30:25 +08:00
24 lines
449 B
Go
24 lines
449 B
Go
package docker
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"zero/tools/goctl/gen"
|
|
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
func DockerCommand(c *cli.Context) error {
|
|
goFile := c.String("go")
|
|
namespace := c.String("namespace")
|
|
if len(goFile) == 0 || len(namespace) == 0 {
|
|
return errors.New("-go and -namespace can't be empty")
|
|
}
|
|
|
|
if err := gen.GenerateDockerfile(goFile, "-f", "etc/config.json"); err != nil {
|
|
return err
|
|
}
|
|
|
|
return gen.GenerateMakefile(goFile, namespace)
|
|
}
|