commands: start apply
This commit is contained in:
parent
a4a4e3784d
commit
046e80361b
|
@ -0,0 +1,37 @@
|
||||||
|
package command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/mitchellh/cli"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ApplyCommand is a Command implementation that applies a Terraform
|
||||||
|
// configuration and actually builds or changes infrastructure.
|
||||||
|
type ApplyCommand struct {
|
||||||
|
Ui cli.Ui
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ApplyCommand) Run(_ []string) int {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ApplyCommand) Help() string {
|
||||||
|
helpText := `
|
||||||
|
Usage: terraform apply [terraform.tf]
|
||||||
|
|
||||||
|
Builds or changes infrastructure according to the Terraform configuration
|
||||||
|
file.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
|
||||||
|
-init If specified, it is okay to build brand new infrastructure
|
||||||
|
(with no state file specified).
|
||||||
|
|
||||||
|
`
|
||||||
|
return strings.TrimSpace(helpText)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ApplyCommand) Synopsis() string {
|
||||||
|
return "Builds or changes infrastructure according to Terrafiles"
|
||||||
|
}
|
|
@ -14,6 +14,12 @@ func init() {
|
||||||
ui := &cli.BasicUi{Writer: os.Stdout}
|
ui := &cli.BasicUi{Writer: os.Stdout}
|
||||||
|
|
||||||
Commands = map[string]cli.CommandFactory{
|
Commands = map[string]cli.CommandFactory{
|
||||||
|
"apply": func() (cli.Command, error) {
|
||||||
|
return &command.ApplyCommand{
|
||||||
|
Ui: ui,
|
||||||
|
}, nil
|
||||||
|
},
|
||||||
|
|
||||||
"version": func() (cli.Command, error) {
|
"version": func() (cli.Command, error) {
|
||||||
return &command.VersionCommand{
|
return &command.VersionCommand{
|
||||||
Revision: GitCommit,
|
Revision: GitCommit,
|
||||||
|
|
Loading…
Reference in New Issue