From 817bf337e85a8fab5ac6f58bf94b1cd3e6a91a8e Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 22 May 2021 13:37:44 +0300
Subject: [PATCH] Fetch Terraform for CI.

it's the default before_script action, but it would only affect the
pre-commit job (all of the others have their own before_script). It
would allow me to not skip the terraform pre-commit checks.
---
 .gitlab-ci.yml          | 9 +++++++++
 .pre-commit-config.yaml | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3a12301..ff71131 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,6 +5,15 @@ include:
   - project: shore/ci-templates
     file: templates/terraform.yml
 
+default:
+  before_script:
+    # yamllint disable-line rule:line-length
+    - wget https://releases.hashicorp.com/terraform/0.15.3/terraform_0.15.3_linux_amd64.zip -O /tmp/terraform.zip
+    - unzip /tmp/terraform.zip terraform -d /usr/local/bin/
+    - terraform version
+    - rm -r .terraform*
+    - touch payload.zip
+
 Generate payload:
   stage: build
   image: registry.shore.co.il/ci-images:python3
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 9c8f669..a014988 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -82,7 +82,7 @@ repos:
           - https://git.shore.co.il
 
   - repo: https://git.shore.co.il/nimrod/terraform-pre-commit.git
-    rev: v0.1.0
+    rev: v0.1.2
     hooks:
       - id: tf-fmt
       - id: tf-validate
-- 
GitLab