mirror of
https://github.com/pgrondek/config.git
synced 2024-11-22 12:03:43 +00:00
[terraform] Add terraform
This commit is contained in:
parent
fe18bdcfd6
commit
09c4730c6c
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
||||
SERVER_PARTS=bash ssh vim docker
|
||||
SERVER_PARTS=bash ssh vim docker terraform
|
||||
CLIENT_PARTS=i3 packages
|
||||
|
||||
.PHONY: clean_install
|
||||
|
32
terraform/Makefile
Normal file
32
terraform/Makefile
Normal file
@ -0,0 +1,32 @@
|
||||
HOME_BIN_DIR=$(HOME)/bin
|
||||
|
||||
ifeq ("x86_64","$(shell uname -m)")
|
||||
ARCH=amd64
|
||||
else
|
||||
ARCH=unknown
|
||||
endif
|
||||
|
||||
TERRAFORM_BIN=$(HOME_BIN_DIR)/terraform
|
||||
TERRAFORM_VERSION=0.12.16
|
||||
TERRAFORM_URL=https://releases.hashicorp.com/terraform/$(TERRAFORM_VERSION)/terraform_$(TERRAFORM_VERSION)_linux_$(ARCH).zip
|
||||
|
||||
.PHONY: install
|
||||
|
||||
clean:
|
||||
rm -f $(TERRAFORM_BIN)
|
||||
|
||||
install:
|
||||
ifeq ("$(wildcard $(TERRAFORM_BIN))","")
|
||||
$(MAKE) download_install_terraform
|
||||
else ifneq ($(shell terraform -v | awk -F'[v]' '{print $$2}'), $(TERRAFORM_VERSION))
|
||||
$(MAKE) download_install_terraform
|
||||
endif
|
||||
|
||||
force_update_compose: clean_compose install_compose
|
||||
|
||||
download_install_terraform: $(HOME_BIN_DIR)
|
||||
wget -qO- $(TERRAFORM_URL) | gunzip -c - > $(TERRAFORM_BIN)
|
||||
chmod +x $(TERRAFORM_BIN)
|
||||
|
||||
$(HOME_BIN_DIR):
|
||||
mkdir -p $(HOME_BIN_DIR)
|
BIN
terraform/terraform
Normal file
BIN
terraform/terraform
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user