linux-on-ibm-z / scripts

16 stars 52 forks source link

Terraform script grep error on new version #5

Closed james-crowley closed 5 years ago

james-crowley commented 5 years ago

When installing terraform via the script, it installs v0.11.11. Which is 2 versions behind the latest version which is v0.11.13.

When editing the script, I changed the PACKAGE_VERSION from 0.11.11 to 0.11.13. This seems like it should redo the install and update the version of terraform. But it fails the script's check to see if the the current PACKAGE_VERSION var is install on the system.

This is do the the output of terraform when issuing the command terraform version on a outdated version.

Terraform v0.11.11

Your version of Terraform is out of date! The latest version
is 0.11.13. You can update by downloading from www.terraform.io/downloads.html

As you can see terraform states the current version as 0.11.11 but also outputs a message about upgrading the the current version of 0.11.13.

So when issuing this command in the script, currently its issuing terraform version | grep "$PACKAGE_VERSION", which will not work. Since if you replace the PACKAGE_VERSION with the current version of 0.11.13 the grep statement will find it in the output and state the current version install on the system is 0.11.13. Thus there is no reason to update.

One possible solution would be to narrow down the grep statement to terraform version | grep "Terraform v$PACKAGE_VERSION"

Just an FYI the current output from a terraform version on the up to date version is:

Terraform v0.11.13
cwsolee commented 5 years ago

Thanks, we'll take this into account when we do 0.11.13 currency, sounds like a good idea to me.

james-crowley commented 5 years ago

@cwsolee Thanks for getting back to me! It looks like @aborkar-ibm fix this issue with https://github.com/linux-on-ibm-z/scripts/commit/fe04f47a509d71950c244931a879d90932a8ce96.

I think you can close this issue.

cwsolee commented 5 years ago

Yup, we're still working on currency to 0.11.13 but just did the easy fix for now.