Skip to content

Commit

Permalink
install tf on ubuntu executor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-jameson committed Dec 19, 2024
1 parent 1244be4 commit 767ea55
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .circleci/deployment/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@
- run:
name: Install dependencies
command: |
sudo apk update
sudo apk add wget bash python3 py3-pip
sudo pip3 install --upgrade pip
ln -s /usr/bin/python3 /usr/bin/python
sudo apt update
sudo apt-get install -y wget
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_amd64 && chmod +x /usr/local/bin/yq
- run:
name: Apply database migrations
Expand Down Expand Up @@ -254,7 +252,10 @@
echo "cf_space_name = \"<<parameters.cf-space>>\""
echo "cf_app_name = \"<<parameters.cf-app>>\""
} >> ./variables.tfvars
sudo apt-get install -y terraform
- run:
name: Terraform Check
command: |
bash ./scripts/terraform-check.sh
- terraform/init:
path: <<parameters.tf-path>>
backend_config_file: ./backend_config.tfvars
Expand Down
14 changes: 14 additions & 0 deletions scripts/terraform-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e
if command -v terraform /dev/null 2>&1; then
echo The command terraform is available
else
apt-get update && apt-get install -y gnupg software-properties-common

wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/hashicorp.list
apt update
apt-get install -y terraform
terraform --version
fi

0 comments on commit 767ea55

Please sign in to comment.