runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.68k stars 1.05k forks source link

Add "terraform_version" in server repo config #923

Open MPV opened 4 years ago

MPV commented 4 years ago

It's nice being able to lock to a specific terraform version like this:

version: 3
projects:
- dir: .
  terraform_version: v0.10.5

https://www.runatlantis.io/docs/terraform-versions.html

But sometimes you prefer having some repos specified in the server repo config, and then it would be nice being able to set terraform_version there too, like this:

repos:
- id: /.*/
  terraform_version: v0.10.5

If you do this today, you get:

Error: initializing server: parsing /etc/atlantis/repos.yaml file: yaml: unmarshal errors: line 6: field terraform_version not found in struct raw.Repo

MPV commented 4 years ago

What do you think @kennethtxytqw (given that you worked on the existing terraform version implementation)?

YesYouKenSpace commented 4 years ago

I was wondering if the flag DEFAULT_TF_VERSION is sufficient to satisfy this use case?

On Tue, 25 Feb 2020, 13:48 Victor Sollerhed, notifications@github.com wrote:

What do you think @kennethtxytqw https://github.com/kennethtxytqw (given that you worked on the existing terraform version implementation)?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/runatlantis/atlantis/issues/923?email_source=notifications&email_token=AD42I3ZATC5DFLJJY5LCTCLRESWJTA5CNFSM4KPY6EP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM2U2BQ#issuecomment-590695686, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD42I3ZHLEM52NSSA6RGM6TRESWJTANCNFSM4KPY6EPQ .

lkysow commented 4 years ago

That would set it for all repos but it sounded like they wanted to be able to set it per repo.

YesYouKenSpace commented 4 years ago

Ah my bad I misinterpreted. I think this is a great idea! Especially for those who are migrating in between versions.