pulumi/cmd/lumi/env.go
Matt Ellis 865422567c Alow multiple instances of engine.Engine
This refactors the engine so all of the APIs on it are instance
methods on the type instead of raw methods that float around and use
data from a global engine.

A mechcanical change as we remove the global `E` and then make
anything that interacted with that in pkg/engine to be an instance
method and the dealing with the fallout.
2017-08-24 18:09:37 -07:00

39 lines
1.2 KiB
Go

// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
package main
import (
"github.com/spf13/cobra"
"github.com/pulumi/pulumi-fabric/pkg/util/cmdutil"
)
func newEnvCmd() *cobra.Command {
var showIDs bool
var showURNs bool
cmd := &cobra.Command{
Use: "env",
Short: "Manage target environments",
Long: "Manage target environments\n" +
"\n" +
"An environment is a named deployment target, and a single project may have many of them.\n" +
"Each environment has a configuration and deployment history associated with it, stored in\n" +
"the workspace, in addition to a full checkpoint of the last known good deployment.\n",
Run: cmdutil.RunFunc(func(cmd *cobra.Command, args []string) error {
return lumiEngine.EnvInfo(showIDs, showURNs)
}),
}
cmd.PersistentFlags().BoolVarP(
&showIDs, "show-ids", "i", false, "Display each resource's provider-assigned unique ID")
cmd.PersistentFlags().BoolVarP(
&showURNs, "show-urns", "u", false, "Display each resource's Lumi-assigned globally unique URN")
cmd.AddCommand(newEnvInitCmd())
cmd.AddCommand(newEnvLsCmd())
cmd.AddCommand(newEnvRmCmd())
cmd.AddCommand(newEnvSelectCmd())
return cmd
}