app

package
v0.1.0-alpha.11 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Copyright 2022 The envd Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var CommandBootstrap = &cli.Command{
	Name:  "bootstrap",
	Usage: "Bootstraps envd installation including shell autocompletion and buildkit image download",
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name:    "buildkit",
			Usage:   "Download the image and bootstrap buildkit",
			Aliases: []string{"b"},
			Value:   true,
		},
		&cli.BoolFlag{
			Name:  "with-autocomplete",
			Usage: "Add envd autocompletions",
			Value: true,
		},
		&cli.StringFlag{
			Name:    "dockerhub-mirror",
			Usage:   "Dockerhub mirror to use",
			Aliases: []string{"m"},
		},
	},

	Action: bootstrap,
}
View Source
var CommandBuild = &cli.Command{
	Name:    "build",
	Aliases: []string{"b"},
	Usage:   "build envd environment",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "tag",
			Usage:   "Name and optionally a tag in the 'name:tag' format (default: PROJECT:dev)",
			Aliases: []string{"t"},
		},
		&cli.PathFlag{
			Name:    "file",
			Usage:   "Name of the build.envd",
			Aliases: []string{"f"},
			Value:   "build.envd",
		},
		&cli.PathFlag{
			Name:    "path",
			Usage:   "Path to the directory containing the build.envd",
			Aliases: []string{"p"},
			Value:   ".",
		},
		&cli.PathFlag{
			Name:    "public-key",
			Usage:   "Path to the public key",
			Aliases: []string{"pubk"},
			Value:   sshconfig.GetPublicKey(),
		},
	},

	Action: build,
}
View Source
var CommandDestroy = &cli.Command{
	Name:    "destroy",
	Aliases: []string{"d"},
	Usage:   "destroys the envd environment",
	Flags: []cli.Flag{
		&cli.PathFlag{
			Name:    "path",
			Usage:   "Path to the directory containing the build.envd",
			Aliases: []string{"p"},
		},
		&cli.PathFlag{
			Name:    "name",
			Usage:   "Name of the environment",
			Aliases: []string{"n"},
		},
	},

	Action: destroy,
}
View Source
var CommandGet = &cli.Command{
	Name:    "get",
	Aliases: []string{"g"},
	Usage:   "Get images, or environments",

	Subcommands: []*cli.Command{
		CommandGetEnvironment,
		CommandGetImage,
	},
}
View Source
var CommandGetEnvironment = &cli.Command{
	Name:    "envs",
	Aliases: []string{"env", "e"},
	Usage:   "List envd environments",

	Subcommands: []*cli.Command{
		CommandGetEnvironmentDependency,
	},
	Action: getEnvironment,
}
View Source
var CommandGetEnvironmentDependency = &cli.Command{
	Name:    "deps",
	Aliases: []string{"dep", "d"},
	Usage:   "List all dependencies",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "env",
			Usage:   "Specify the envd environment to use",
			Aliases: []string{"e"},
		},
		&cli.PathFlag{
			Name:    "private-key",
			Usage:   "Path to the private key",
			Aliases: []string{"k"},
			Value:   sshconfig.GetPrivateKey(),
		},
	},
	Action: getEnvironmentDependency,
}
View Source
var CommandGetImage = &cli.Command{
	Name:    "images",
	Aliases: []string{"image", "i"},
	Usage:   "List envd images",

	Subcommands: []*cli.Command{
		CommandGetImageDependency,
	},

	Action: getImage,
}
View Source
var CommandGetImageDependency = &cli.Command{
	Name:    "deps",
	Aliases: []string{"dep", "d"},
	Usage:   "List all dependencies in the image",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "image",
			Usage:   "Specify the image to use",
			Aliases: []string{"i"},
		},
	},
	Action: getImageDependency,
}
View Source
var CommandPause = &cli.Command{
	Name:    "pause",
	Aliases: []string{"p"},
	Usage:   "pause the envd environment",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "env",
			Usage:   "environment name",
			Aliases: []string{"e"},
		},
	},

	Action: pause,
}
View Source
var CommandResume = &cli.Command{
	Name:    "resume",
	Aliases: []string{"r"},
	Usage:   "resume the envd environment",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "env",
			Usage:   "environment name",
			Aliases: []string{"e"},
		},
	},

	Action: resume,
}
View Source
var CommandUp = &cli.Command{
	Name:    "up",
	Aliases: []string{"u"},
	Usage:   "build and run the envd environment",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "tag",
			Usage:   "Name and optionally a tag in the 'name:tag' format (default: PROJECT:dev)",
			Aliases: []string{"t"},
		},
		&cli.PathFlag{
			Name:    "path",
			Usage:   "Path to the directory containing the build.envd",
			Aliases: []string{"p"},
			Value:   ".",
		},
		&cli.StringSliceFlag{
			Name:    "volume",
			Usage:   "Mount host directory into container",
			Aliases: []string{"v"},
		},
		&cli.PathFlag{
			Name:    "file",
			Usage:   "Name of the build.envd",
			Aliases: []string{"f"},
			Value:   "build.envd",
		},

		&cli.PathFlag{
			Name:    "private-key",
			Usage:   "Path to the private key",
			Aliases: []string{"k"},
			Value:   sshconfig.GetPrivateKey(),
		},
		&cli.PathFlag{
			Name:    "public-key",
			Usage:   "Path to the public key",
			Aliases: []string{"pubk"},
			Value:   sshconfig.GetPublicKey(),
		},
		&cli.DurationFlag{
			Name:  "timeout",
			Usage: "Timeout of container creation",
			Value: time.Second * 30,
		},
		&cli.BoolFlag{
			Name:  "detach",
			Usage: "detach from the container",
			Value: false,
		},
	},

	Action: up,
}
View Source
var CommandVersion = &cli.Command{
	Name:    "version",
	Aliases: []string{"v"},
	Usage:   "Print envd version information",
	Action:  printVersion,
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name:    "short",
			Usage:   "Only print the version number",
			Value:   false,
			Aliases: []string{"s"},
		},
	},
}

Functions

This section is empty.

Types

type EnvdApp

type EnvdApp struct {
	cli.App
}

func New

func New() EnvdApp

Jump to

Keyboard shortcuts

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