From 051f2444b4cf89092dfdbf2466ab48d649d9a12c Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 19:03:24 +0000 Subject: [PATCH 1/4] tofu pipeline with secrets --- .gitea/workflows/ci-test.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index 7fce976..50d52c2 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -16,12 +16,31 @@ jobs: - name: Cloning iac repository uses: actions/checkout@v4 + with: + path: infra/iac + + - name: cloning iac secrets repository + run: | + git clone https://gitea.fenix-dev.com/fenix-gitea-admin/iac-teste-secrets.git infra/secrets + + + - name: Init and Apply + env: + CONSUL_HTTP_TOKEN: ${{ secrets.CONSUL_HTTP_TOKEN }} - name: Init OpenTofu + working-directory: infra run: tofu init - name: Plan run: tofu plan -out=tfplan + - name: Export tfplan + uses: actions/upload-artifact@v4 + with: + name: tofu-plan + path: tfplan + + - name: Apply run: tofu apply -auto-approve tfplan \ No newline at end of file From d3913e600cea73f3351e3531410fcc07749351b3 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 19:06:54 +0000 Subject: [PATCH 2/4] env correction --- .gitea/workflows/ci-test.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index 50d52c2..9844155 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -9,6 +9,8 @@ jobs: hello: #precisa da imagem costum do opentofu runs-on: [ fenix-opentofu ] + env: + CONSUL_HTTP_TOKEN: ${{ secrets.CONSUL_HTTP_TOKEN }} steps: - name: Updating apt-get run: | @@ -23,11 +25,6 @@ jobs: run: | git clone https://gitea.fenix-dev.com/fenix-gitea-admin/iac-teste-secrets.git infra/secrets - - - name: Init and Apply - env: - CONSUL_HTTP_TOKEN: ${{ secrets.CONSUL_HTTP_TOKEN }} - - name: Init OpenTofu working-directory: infra run: tofu init From bf3d49edc247cd1ff5f511164bdea8e41fddb563 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 19:17:18 +0000 Subject: [PATCH 3/4] gitea clone and token --- .gitea/workflows/ci-test.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index 9844155..a132c60 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -21,9 +21,12 @@ jobs: with: path: infra/iac - - name: cloning iac secrets repository - run: | - git clone https://gitea.fenix-dev.com/fenix-gitea-admin/iac-teste-secrets.git infra/secrets + - name: cloning iac secrets repository + uses: actions/checkout@v4 + with: + repository: fenix-gitea-admin/iac-teste-secrets + token: ${{ secrets.GGITEA_TOKEN }} + path: infra/secrets - name: Init OpenTofu working-directory: infra From 9578a3d29c499077d5147eea5f349a967896ec1f Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Mon, 18 Aug 2025 19:48:18 +0000 Subject: [PATCH 4/4] working dir for opentofu --- .gitea/workflows/ci-test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index a132c60..edbd057 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -33,9 +33,11 @@ jobs: run: tofu init - name: Plan + working-directory: infra run: tofu plan -out=tfplan - name: Export tfplan + working-directory: infra uses: actions/upload-artifact@v4 with: name: tofu-plan @@ -43,4 +45,5 @@ jobs: - name: Apply + working-directory: infra run: tofu apply -auto-approve tfplan \ No newline at end of file