From 75b0eb0f63bfa990404bf3500042278283ee26ea Mon Sep 17 00:00:00 2001 From: oscarpocock Date: Sat, 3 Dec 2022 02:03:42 +0000 Subject: [PATCH] Added makefile and woodpecker folder for CI --- .woodpecker/deploy.yml | 9 +++++++++ Makefile | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .woodpecker/deploy.yml create mode 100644 Makefile diff --git a/.woodpecker/deploy.yml b/.woodpecker/deploy.yml new file mode 100644 index 0000000..f8541fd --- /dev/null +++ b/.woodpecker/deploy.yml @@ -0,0 +1,9 @@ +branches: main + +pipeline: + init: + image: hashicorp/terraform + commands: + - CODE_PATH=./hetzner/template make init + + \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..32f12a5 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +CODE_PATH ?= . + +init: + @cd $(CODE_PATH) && terraform init -reconfigure -upgrade + +plan: init validate + @cd $(CODE_PATH) && terraform plan + +apply: init validate + @cd $(CODE_PATH) && terraform apply --auto-approve + +refresh: init validate + @cd $(CODE_PATH) && terraform refresh + +fmt: + @cd $(CODE_PATH) && terraform fmt -check -recursive + +validate: + @cd $(CODE_PATH) && terraform validate + +output: init + @cd $(CODE_PATH) && terraform output \ No newline at end of file