MitocGroup / recink

REciNK - Rethink Continuous Integration for JavaScript Applications
https://www.npmjs.org/package/recink
Mozilla Public License 2.0
14 stars 5 forks source link

Overwrite tfvar files doesn't work properly #120

Closed eistrati closed 6 years ago

eistrati commented 6 years ago

I have the following setup:

1) In .recink.yml

your_tf_script_name:
  root: './your_tf_script_path'
  terraform:
    plan: true
    apply: false
    destroy: false
    var-files:
      - prod.tfvars
      - common1.tfvars
      - common2.tfvars
...

2) In CLI

recink run terraform -vv \
  --tf-varfiles="dev.tfvars,common.tfvars"

Expected result: apply values from dev.tfvars and common.tfvars Actual result: apply values from dev.tfvars, common.tfvars and common2.tfvars

avozicov commented 6 years ago

Test Failed

I am facing the following error when running recink run terraform with --tf-vars options Cannot read property 'trim' of undefined

Please refer to attachment for more details:

screen shot 2018-02-01 at 16 06 06
avozicov commented 6 years ago

I would suggest a minor improvement for the following use case:

Actual result:

ddimitrioglo commented 6 years ago

@avozicov Fixed in https://github.com/MitocGroup/recink/pull/136. Now --var-files="" or --var-files=" " will be skipped

ddimitrioglo commented 6 years ago

@avozicov FYI. The main requirements for all the FT parameters were described here:

Clarification:
1. --tf-workspace="dev" <==> --custom-config="your_tf_script_name.terraform.current-workspace:dev"
2. --tf-version="0.11.0" <==> --custom-config="$.terraform.version:0.11.0"
3. --include-modules or --exclude-modules && --tf-version="0.11.0" <==> --custom-config="module1.terraform.version:0.11.0,module2.terraform.version:0.11.0,..."
4. --tf-varfiles="v0,v1,..." <==> --custom-config="$.terraform.var-files.0:v0,$.terraform.var-files.1:v1,..."
5. --include-modules or --exclude-modules && --tf-varfiles="v0,v1,..." <==> --custom-config="module1.terraform.var-files.0:v0,module1.terraform.var-files.1:v1,...,module2.terraform.var-files.0:v0,module2.terraform.var-files.1:v1,..."
avozicov commented 6 years ago

Test Passed Acceptance Criteria:

eistrati commented 6 years ago

Checked.