Add GitHub Actions workflows for OpenTofu K8S Apps apply and validate; update S3 backend configuration
This commit is contained in:
+6
-6
@@ -1,4 +1,4 @@
|
||||
name: Terraform K8S Apps apply
|
||||
name: OpenTofu K8S Apps apply
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -31,8 +31,8 @@ jobs:
|
||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||
host-group: microk8s
|
||||
|
||||
- name: Setup Terraform Environment
|
||||
uses: ./.github/actions/setup-terraform-env
|
||||
- name: Setup OpenTofu Environment
|
||||
uses: ./.github/actions/setup-opentofu-env
|
||||
|
||||
- name: Setup Kubernetes Environment
|
||||
uses: ./.github/actions/setup-k8s-env
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
access-token: ${{ secrets.BW_ACCESS_TOKEN }}
|
||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||
|
||||
- name: Terraform Init and Apply
|
||||
- name: OpenTofu Init and Apply
|
||||
env:
|
||||
BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }}
|
||||
BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }}
|
||||
@@ -51,5 +51,5 @@ jobs:
|
||||
SSH_AUTH_SOCK: ${{ steps.setup_ansible_env.outputs.ssh-auth-sock }}
|
||||
run: |
|
||||
cd terraform/k8sapps
|
||||
sectool -f ../../sectool.json exec terraform init
|
||||
sectool -f ../../sectool.json exec terraform apply --auto-approve
|
||||
sectool -f ../../sectool.json exec tofu init
|
||||
sectool -f ../../sectool.json exec tofu apply --auto-approve
|
||||
+8
-8
@@ -1,4 +1,4 @@
|
||||
name: Terraform K8s Apps Validate on Pull Request
|
||||
name: OpenTofu K8s Apps Validate on Pull Request
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -33,8 +33,8 @@ jobs:
|
||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||
host-group: microk8s
|
||||
|
||||
- name: Setup Terraform Environment
|
||||
uses: ./.github/actions/setup-terraform-env
|
||||
- name: Setup OpenTofu Environment
|
||||
uses: ./.github/actions/setup-opentofu-env
|
||||
|
||||
- name: Setup Kubernetes Environment
|
||||
uses: ./.github/actions/setup-k8s-env
|
||||
@@ -44,14 +44,14 @@ jobs:
|
||||
access-token: ${{ secrets.BW_ACCESS_TOKEN }}
|
||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||
|
||||
- name: Terraform Init and Validate
|
||||
- name: OpenTofu Init and Validate
|
||||
env:
|
||||
BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }}
|
||||
BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }}
|
||||
BW_ACCESS_TOKEN: ${{ secrets.BW_ACCESS_TOKEN }}
|
||||
run: |
|
||||
cd terraform/k8sapps
|
||||
sectool -f ../../sectool.json exec terraform init
|
||||
sectool -f ../../sectool.json exec terraform validate
|
||||
sectool -f ../../sectool.json exec terraform fmt -check
|
||||
sectool -f ../../sectool.json exec terraform plan
|
||||
sectool -f ../../sectool.json exec tofu init
|
||||
sectool -f ../../sectool.json exec tofu validate
|
||||
sectool -f ../../sectool.json exec tofu fmt -check
|
||||
sectool -f ../../sectool.json exec tofu plan
|
||||
@@ -1,7 +1,7 @@
|
||||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "a13labs.infra"
|
||||
key = "alexpires.me-k8sapps.tfstate"
|
||||
region = "us-east-1"
|
||||
bucket = "a13labs.infra.eu"
|
||||
key = "k8sapps.core.infra.tfstate"
|
||||
region = "eu-west-1"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user