From 64a61140714690d286d3508bc24cb8c9035524f3 Mon Sep 17 00:00:00 2001 From: Larry <34108925+gamethis@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:36:30 -0600 Subject: [PATCH] Update code_space.sh --- code_space.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/code_space.sh b/code_space.sh index 60ab8f8..34e6b43 100755 --- a/code_space.sh +++ b/code_space.sh @@ -36,10 +36,26 @@ pre-commit install echo "Done install pre-commit." echo "=========================" -echo "Install tflint and tfsec" -curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash -curl -s https://raw.githubusercontent.com/aquasecurity/tfsec/master/scripts/install_linux.sh | bash -echo "Done install tflint and tfsec" +echo "Install tflint" +TFLINT_VERSION="0.48.0" +INSTALL_PATH="/usr/local/bin" +platform=$(uname -s | tr '[:upper:]' '[:lower:]') +arch=$(uname -m) +if [ "$arch" == "x86_64" ]; then + arch="amd64" + fi +filename="tflint_${platform}_${arch}.zip" +curl -s -LO "https://github.com/terraform-linters/tflint/releases/download/v${TFLINT_VERSION}/${filename}" +sudo unzip $filename -d "${INSTALL_PATH}" + +echo "Done installing tflint" +echo "=========================" + +echo "install trivy" +TRIVY_VERSION="0.47.0" +curl --retry 3 --retry-delay 5 -sSL "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" | sudo tar xz -C /usr/local/bin --overwrite + +echo "Done install trivy" echo "=========================" echo "run pre-commit"