install-ubuntu.sh 1.0 KB

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. echo 'installing dependencies'
  3. sudo apt install python3-pip gawk &&\
  4. pip3 install pre-commit
  5. curl -L "$(curl -sL https://api.github.com/repos/segmentio/terraform-docs/releases/latest | grep -o -E "https://.+?-linux-amd64")" > terraform-docs && chmod +x terraform-docs && sudo mv terraform-docs /usr/bin/
  6. curl -L "$(curl -sL https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" > tflint.zip && unzip tflint.zip && rm tflint.zip && sudo mv tflint /usr/bin/
  7. env GO111MODULE=on go get -u github.com/liamg/tfsec/cmd/tfsec
  8. git clone https://github.com/tfutils/tfenv.git ~/.tfenv || true
  9. mkdir -p ~/.local/bin/
  10. . ~/.profile
  11. ln -s ~/.tfenv/bin/* ~/.local/bin
  12. echo 'installing pre-commit hooks'
  13. pre-commit install
  14. echo 'setting pre-commit hooks to auto-install on clone in the future'
  15. git config --global init.templateDir ~/.git-template
  16. pre-commit init-templatedir ~/.git-template
  17. echo 'installing terraform with tfenv'
  18. tfenv install min-required
  19. tfenv use min-required