You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
471 B
Go
23 lines
471 B
Go
package docker
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/tal-tech/go-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)
|
|
}
|