all repos — chtf @ 5422426a09e56346ec782adcab526c1a6e7fd83a

simple terraform version manager

README

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
         `~* chtf *~`

  chtf is a ~30 line posix shell script
  that manages terraform versions.

  i made it because existing solutions
  seemed way too big for what i thought
  was a simple problem.


      ??? deps+install ???

  to install chtf, just put it anywhere in
  your $PATH. i recommend ~/bin

  you'll need these deps:
    - curl
    - unzip

  you'll also need ~/bin in your $PATH near
  the beginning somewhere, since chtf relies
  on symlinking ~/bin/terraform to the proper
  version.


       !!! demo !!!

  here's a full demo of chtf's capabilities:

  # list versions (* represents active)

    $ chtf
    0.11.1
    0.12.1*

  # switch to a different installed version
    $ chtf 0.11.1
    $ chtf
    0.11.1*
    0.12.1
    $ ~/bin/terraform version
    Terraform v0.11.1

  # download a new version and make it active

    $ chtf 1.2.5
    terraform version not found
    downloading https://releases.hashicorp.com/terraform/1.2.5/terraform_1.2.5_linux_amd64.zip
    $ ~/bin/terraform version
    Terraform v1.2.5
    on linux_amd64


  todo:
    - [ ] add arm support
    - [ ] add auto-switching based on .terraform-version file
    - [ ] add refuse to run if doesn't match .terraform-version file