build

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:  "build",
	Usage: "build image on cluster",

	Flags: []cli.Flag{
		app.NamespaceFlag,

		&cli.StringFlag{
			Name:  "image",
			Usage: "image name (format: registry/repository:tag)",
		},

		&cli.BoolFlag{
			Name:  "insecure",
			Usage: "use insecure registry",
		},

		&cli.StringFlag{
			Name:  "username",
			Usage: "registry username",
		},

		&cli.StringFlag{
			Name:  "password",
			Usage: "registry password",
		},
	},

	Action: func(ctx context.Context, cmd *cli.Command) error {
		client := app.MustClient(ctx, cmd)

		path, err := ParsePath(cmd.Args().Get(0))

		if err != nil {
			return err
		}

		image, err := ParseImage(cmd.String("image"))

		if err != nil {
			return err
		}

		image.Insecure = cmd.Bool("insecure")

		image.Username = cmd.String("username")
		image.Password = cmd.String("password")

		return Run(ctx, client, "", image, path, "")
	},
}

Functions

func ParsePath

func ParsePath(path string) (string, error)

func Run

func Run(ctx context.Context, client kubernetes.Client, namespace string, image Image, dir, dockerfile string) error

Types

type Image

type Image struct {
	Name string
	Tag  string

	Insecure bool
	Registry string

	Username string
	Password string
}

func ParseImage

func ParseImage(image string) (Image, error)

func (*Image) String

func (i *Image) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL