From cbe175e524e2b1164050ee19f6ade7381646d1fa Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 20:02:14 +0000 Subject: [PATCH 1/8] Update .gitea/workflows/ci-test.yaml --- .gitea/workflows/ci-test.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index edbd057..f118059 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -28,13 +28,22 @@ jobs: token: ${{ secrets.GGITEA_TOKEN }} path: infra/secrets + - name: Init OpenTofu + working-directory: infra + run: | + # Find all .auto.tfvars in the secrets folder + VAR_FILES="" + for f in secrets/*.auto.tfvars; do + VAR_FILES="$VAR_FILES -var-file=$f" + done + - name: Init OpenTofu working-directory: infra run: tofu init - name: Plan working-directory: infra - run: tofu plan -out=tfplan + run: tofu plan -chdir=iac $VAR_FILES -out=tfplan - name: Export tfplan working-directory: infra @@ -46,4 +55,4 @@ jobs: - name: Apply working-directory: infra - run: tofu apply -auto-approve tfplan \ No newline at end of file + run: tofu apply -chdir=iac $VAR_FILES -auto-approve tfplan \ No newline at end of file From 5b5d75d0ebad80a22ca4cd21d09d0f4d2533afb9 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 20:05:43 +0000 Subject: [PATCH 2/8] changing working dir for plan and apply --- .gitea/workflows/ci-test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index f118059..5d5a437 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -42,8 +42,8 @@ jobs: run: tofu init - name: Plan - working-directory: infra - run: tofu plan -chdir=iac $VAR_FILES -out=tfplan + working-directory: infra/iac + run: tofu plan $VAR_FILES -out=tfplan - name: Export tfplan working-directory: infra @@ -54,5 +54,5 @@ jobs: - name: Apply - working-directory: infra - run: tofu apply -chdir=iac $VAR_FILES -auto-approve tfplan \ No newline at end of file + working-directory: infra/iac + run: tofu apply $VAR_FILES -auto-approve tfplan \ No newline at end of file From 3b7cf4e710950b383788be80fc8ab6cb67215fc2 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 20:08:42 +0000 Subject: [PATCH 3/8] tofu init on wright path --- .gitea/workflows/ci-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index 5d5a437..d3c6f64 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -38,7 +38,7 @@ jobs: done - name: Init OpenTofu - working-directory: infra + working-directory: infra/iac run: tofu init - name: Plan From 1b204eeb66d953ce8eef287304cb47e54c7a8eb8 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 20:11:41 +0000 Subject: [PATCH 4/8] variables path correction --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index fc1d9ed..007d85d 100644 --- a/main.tf +++ b/main.tf @@ -20,5 +20,5 @@ terraform { provider "random" {} module "my_variables" { - source = "../variables" # path to the folder + source = "variables" # path to the folder } \ No newline at end of file From a79d007857741b3857fcf8af8c01ece314b32c18 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 20:13:44 +0000 Subject: [PATCH 5/8] variables path correction --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 007d85d..292a6b7 100644 --- a/main.tf +++ b/main.tf @@ -20,5 +20,5 @@ terraform { provider "random" {} module "my_variables" { - source = "variables" # path to the folder + source = "./variables" # path to the folder } \ No newline at end of file From 69c5d44b08e4c7df6eb8319e8990dee7b3b790f1 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 20:35:26 +0000 Subject: [PATCH 6/8] Update .gitea/workflows/ci-test.yaml --- .gitea/workflows/ci-test.yaml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index d3c6f64..01a52af 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -28,22 +28,19 @@ jobs: token: ${{ secrets.GGITEA_TOKEN }} path: infra/secrets - - name: Init OpenTofu - working-directory: infra - run: | - # Find all .auto.tfvars in the secrets folder - VAR_FILES="" - for f in secrets/*.auto.tfvars; do - VAR_FILES="$VAR_FILES -var-file=$f" - done - - name: Init OpenTofu working-directory: infra/iac run: tofu init - name: Plan working-directory: infra/iac - run: tofu plan $VAR_FILES -out=tfplan + run:| + # Find all .auto.tfvars in the secrets folder + VAR_FILES="" + for f in ../secrets/*.auto.tfvars; do + VAR_FILES="$VAR_FILES -var-file=$f" + done + tofu plan $VAR_FILES -out=tfplan - name: Export tfplan working-directory: infra @@ -55,4 +52,10 @@ jobs: - name: Apply working-directory: infra/iac - run: tofu apply $VAR_FILES -auto-approve tfplan \ No newline at end of file + run: | + # Find all .auto.tfvars in the secrets folder + VAR_FILES="" + for f in ../secrets/*.auto.tfvars; do + VAR_FILES="$VAR_FILES -var-file=$f" + done + tofu apply $VAR_FILES -auto-approve tfplan \ No newline at end of file From a704361729580e32fe4e52e18bc20b8d3f6076b5 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 20:35:46 +0000 Subject: [PATCH 7/8] Update .gitea/workflows/ci-test.yaml --- .gitea/workflows/ci-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index 01a52af..da348b4 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -34,7 +34,7 @@ jobs: - name: Plan working-directory: infra/iac - run:| + run: | # Find all .auto.tfvars in the secrets folder VAR_FILES="" for f in ../secrets/*.auto.tfvars; do From fb5e5156930e16676add3d6dbe7121cff59c237a Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 20:52:31 +0000 Subject: [PATCH 8/8] Update .gitea/workflows/ci-test.yaml --- .gitea/workflows/ci-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index da348b4..9f70113 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -37,7 +37,7 @@ jobs: run: | # Find all .auto.tfvars in the secrets folder VAR_FILES="" - for f in ../secrets/*.auto.tfvars; do + for f in ../secrets/secrets/*.auto.tfvars; do VAR_FILES="$VAR_FILES -var-file=$f" done tofu plan $VAR_FILES -out=tfplan @@ -55,7 +55,7 @@ jobs: run: | # Find all .auto.tfvars in the secrets folder VAR_FILES="" - for f in ../secrets/*.auto.tfvars; do + for f in ../secrets/secrets/*.auto.tfvars; do VAR_FILES="$VAR_FILES -var-file=$f" done tofu apply $VAR_FILES -auto-approve tfplan \ No newline at end of file