Commit Graph

36 Commits

Author SHA1 Message Date
Mitchell Hashimoto 475d8750bb
command/push: make test more resilient 2016-08-26 13:38:02 -07:00
Mitchell Hashimoto 2f8baa4580
command/push: fix tests to be vcs=false GH-8478 2016-08-25 14:09:34 -07:00
Mitchell Hashimoto 9a8209cfbd
command/push: create the proper parent directory entries in tar 2016-08-24 10:39:50 -07:00
Mitchell Hashimoto 92b15de080
command/push: remove the old test fixture for the new one 2016-08-23 23:16:30 -07:00
Mitchell Hashimoto a650455ed6
command/push: only explicitly include the state
modify the module include flag to flag whether we explicitly include or
exclude modules
2016-08-23 23:12:52 -07:00
Mitchell Hashimoto f0de3c3e91
command/push: removed all the git stuff, turns out it doesn't matter 2016-08-23 22:51:37 -07:00
Mitchell Hashimoto e8267f4907
command/push: failing test for pushing with no modules 2016-08-23 22:49:00 -07:00
Mitchell Hashimoto 70cc108614
Revert "command/push: test that -upload-modules=false works"
This reverts commit edda576452.
2016-08-23 22:00:02 -07:00
Mitchell Hashimoto edda576452
command/push: test that -upload-modules=false works 2016-08-23 17:40:40 -07:00
James Bardin 1322aaf473 Merge pull request #7989 from hashicorp/jbardin/tf_push
Override atlas variables even if they aren't local
2016-08-05 08:43:51 -04:00
James Bardin 67bd4f29e0 Override atlas variables even if they aren't local
Some Atlas usage patterns expect to be able to override a variable set
in Atlas, even if it's not seen in the local context. This allows
overwriting a variable that is returned from atlas, and sends it back.

Also use a unique sential value in the context where we have variables
from atlas. This way atals variables aren't combined with the local
variables, and we don't do something like inadvertantly change the type,
double encode/escape, etc.
2016-08-04 17:26:41 -04:00
James Bardin d5fbb5f5c0 Modify the tfvars test to also use a cli var
Modify the test to demonstrate where cli vars were being lost because
they weren't interpreted as strings.
2016-08-04 17:19:02 -04:00
James Bardin 0c714592f0 Fix variable handling on subsequent pushes
The handling of remote variables was completely disabled for push.
We still need to fetch variables from atlas for push, because if the
variable is only set remotely the Input walk will still prompt the user
for a value. We add the missing remote variables to the context
to disable input.

We now only handle remote variables as atlas.TFVar and explicitly pass
around that type rather than an `interface{}`.

Shorten the text fixture slightly to make the output a little more
readable on failures.
2016-07-28 15:06:53 -04:00
James Bardin 8038e60a20 Add a function to quote HCL strings
The strings we have in the variables may contain escaped double-quotes,
which have already been parsed and had the `\`s removed. We need to
re-escape these, but only if we are in the outer string and not inside an
interpolation.
2016-07-27 10:03:04 -04:00
James Bardin de87267697 Add tf_vars to the variables sent in push
Add tf_vars to the data structures sent in terraform push.

This takes any value of type []interface{} or map[string]interface{} and
marshals it as a string representation of the equivalent HCL. This
prevents ambiguity in atlas between a string that looks like a json
structure, and an actual json structure.

For the time being we will need a way to serialize data as HCL, so the
command package has an internal encodeHCL function to do so. We can
remove this if we get complete package for marshaling HCL.
2016-07-26 20:38:50 -04:00
James Nugent 5d18f41f04 core: Convert context vars to map[string]interface{}
This is the first step in allowing overrides of map and list variables.
We convert Context.variables to map[string]interface{} from
map[string]string and fix up all the call sites.
2016-07-18 13:02:54 -05:00
Mitchell Hashimoto 9d9bcc2f6e command/push: update flag to -overwrite, update docs 2015-06-29 13:53:05 -07:00
Mitchell Hashimoto dc40f044f0 command/push: prefer Atlas over local, add -set flag 2015-06-29 12:24:13 -07:00
Mitchell Hashimoto 96b53cc06c command: ask for input even if tfvars is set [GH-2161] 2015-06-25 15:29:46 -07:00
Paul Hinze 8ce3e1d5b4 command/push: local vars override remote ones
Otherwise once you push a variable it becomes very difficult to change.
2015-05-08 18:54:38 -05:00
Paul Hinze a2cb77058c command: fix push tests when running outside repo
VCS detection was on by default, and blows up when the tests are run in
a copy of the Terraform source that is not a git repository, like - say
- during a Homebrew formula install, just to pick a random example. :)
2015-04-09 18:46:25 -05:00
Mitchell Hashimoto 000d28c489 command/push: read terraform.tfvars 2015-04-07 15:34:06 -07:00
Mitchell Hashimoto da46e16f4f command/push: can set the name on the CLI 2015-03-24 13:30:23 -07:00
Mitchell Hashimoto 5e27bfc040 command/push: read name from the config 2015-03-24 13:30:23 -07:00
Mitchell Hashimoto eebd7b8aa3 command/push: ask for only variables that are unset 2015-03-24 13:30:23 -07:00
Mitchell Hashimoto bf14143369 command/push: test that input is asked 2015-03-24 13:30:22 -07:00
Mitchell Hashimoto d37d9ea6ef command/push: send the context variables up 2015-03-24 13:30:22 -07:00
Mitchell Hashimoto a1b424d53f command/push: properly copy the data directory no matter what 2015-03-24 13:30:22 -07:00
Mitchell Hashimoto 22087181af command/push: archive, upload 2015-03-24 13:30:22 -07:00
Mitchell Hashimoto cdde9149ff command/push: start it 2015-03-24 13:30:21 -07:00
Mitchell Hashimoto 01cd761023 command: move remote configuration stuff 2015-03-04 16:17:30 -08:00
Mitchell Hashimoto 0d39a5d9a7 command/push: no more remote package 2015-02-23 15:13:55 -08:00
Armon Dadgar 9168a0f1ce command: Simplify push/pull, depend on remote command for setup 2014-12-10 13:27:08 -08:00
Armon Dadgar 09d7fb7c27 command: cleanup test function names 2014-12-10 13:27:08 -08:00
Armon Dadgar 7ba0c003f2 command/push: Allow existing state file to enable remote 2014-12-10 13:27:08 -08:00
Armon Dadgar 38002904f4 command/push: Adding the push command 2014-12-10 13:27:08 -08:00