From 395dd04861929cf90aae5d572d46e59600742af3 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 24 Mar 2015 17:03:59 -0700 Subject: [PATCH] command/push: accept -vcs --- command/push.go | 8 ++++++-- website/source/docs/commands/push.html.markdown | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/command/push.go b/command/push.go index 63b6d2d69..05e4de18f 100644 --- a/command/push.go +++ b/command/push.go @@ -22,7 +22,7 @@ type PushCommand struct { func (c *PushCommand) Run(args []string) int { var atlasToken string - var moduleUpload bool + var archiveVCS, moduleUpload bool var name string args = c.Meta.process(args, false) cmdFlags := c.Meta.flagSet("push") @@ -30,6 +30,7 @@ func (c *PushCommand) Run(args []string) int { cmdFlags.StringVar(&atlasToken, "token", "", "") cmdFlags.BoolVar(&moduleUpload, "module-upload", true, "") cmdFlags.StringVar(&name, "name", "", "") + cmdFlags.BoolVar(&archiveVCS, "vcs", true, "") cmdFlags.Usage = func() { c.Ui.Error(c.Help()) } if err := cmdFlags.Parse(args); err != nil { return 1 @@ -136,7 +137,7 @@ func (c *PushCommand) Run(args []string) int { // Build the archiving options, which includes everything it can // by default according to VCS rules but forcing the data directory. archiveOpts := &archive.ArchiveOpts{ - VCS: true, + VCS: archiveVCS, Extra: map[string]string{ DefaultDataDir: c.DataDir(), }, @@ -195,6 +196,9 @@ Options: -token= Access token to use to upload. If blank, the ATLAS_TOKEN environmental variable will be used. + -vcs=true If true (default), push will upload only files + comitted to your VCS, if detected. + ` return strings.TrimSpace(helpText) } diff --git a/website/source/docs/commands/push.html.markdown b/website/source/docs/commands/push.html.markdown index 130067416..e35ca2453 100644 --- a/website/source/docs/commands/push.html.markdown +++ b/website/source/docs/commands/push.html.markdown @@ -52,6 +52,11 @@ The command-line flags are all optional. The list of available flags are: * `-token=` - Atlas API token to use to authorize the upload. If blank, the `ATLAS_TOKEN` environmental variable will be used. +* `-vcs=true` - If true (default), then Terraform will detect if a VCS + is in use, such as Git, and will only upload files that are comitted to + version control. If no version control system is detected, Terraform will + upload all files in `path` (parameter to the command). + ## Packaged Files The files that are uploaded and packaged with a `push` are all the