コード例 #1
0
ファイル: client.go プロジェクト: uniite/deis
// Install loads the definitions of components from local unit files.
// After Install, the components will be available to Start.
func (c *Client) Install(argv []string) error {
	usage := fmt.Sprintf(`Loads the definitions of components from local unit files.

After install, the components will be available to start.

"deisctl install" looks for unit files in these directories, in this order:
- the $DEISCTL_UNITS environment variable, if set
- $HOME/.deis/units
- /var/lib/deis/units

Usage:
  deisctl install [<target>...] [options]

Options:
  --router-mesh-size=<num>  Number of routers to be loaded when installing the platform [default: %d].
`, cmd.DefaultRouterMeshSize)
	// parse command-line arguments
	args, err := docopt.Parse(usage, argv, true, "", false)
	if err != nil {
		return err
	}

	meshSizeArg, _ := args["--router-mesh-size"].(string)
	parsedValue, err := strconv.ParseUint(meshSizeArg, 0, 8)
	if err != nil || parsedValue < 1 {
		fmt.Print("Error: argument --router-mesh-size: invalid value, make sure the value is an integer between 1 and 255.\n")
		return err
	}
	cmd.RouterMeshSize = uint8(parsedValue)

	return cmd.Install(args["<target>"].([]string), c.Backend, c.configBackend, cmd.CheckRequiredKeys)
}
コード例 #2
0
ファイル: client.go プロジェクト: gpxl/deis
// Install loads the definitions of components from local unit files.
// After Install, the components will be available to Start.
func (c *Client) Install(argv []string) error {
	usage := `Loads the definitions of components from local unit files.

After install, the components will be available to start.

"deisctl install" looks for unit files in these directories, in this order:
- the $DEISCTL_UNITS environment variable, if set
- $HOME/.deis/units
- /var/lib/deis/units

Usage:
  deisctl install [<target>...] [options]
`
	// parse command-line arguments
	args, err := docopt.Parse(usage, argv, true, "", false)
	if err != nil {
		return err
	}

	return cmd.Install(args["<target>"].([]string), c.Backend, cmd.CheckRequiredKeys)
}
コード例 #3
0
ファイル: client.go プロジェクト: ericcapricorn/deis
// Install loads the definitions of components from local unit files.
// After Install, the components will be available to Start.
func (c *Client) Install(argv []string) error {
	return cmd.Install(argv, c.Backend)
}