mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-10 07:12:20 -05:00
merge from main
This commit is contained in:
117
.github/workflows/drift.yml
vendored
117
.github/workflows/drift.yml
vendored
@@ -24,67 +24,78 @@ jobs:
|
||||
terraform_wrapper: false
|
||||
|
||||
- name: Check for drift
|
||||
uses: dflook/terraform-check@v1
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
||||
TF_VAR_cf_user: ${{ secrets.CLOUDGOV_USERNAME }}
|
||||
TF_VAR_cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
||||
with:
|
||||
path: terraform/staging
|
||||
run: |
|
||||
cd terraform/staging
|
||||
terraform init
|
||||
terraform plan -detailed-exitcode
|
||||
exit_code=$?
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
echo "No changes detected. Intrastructure is up-to-date."
|
||||
elif [ $exit_code -eq 2 ]; then
|
||||
echo "Changes detected. Infrastructure drift found."
|
||||
exit 1
|
||||
else
|
||||
echo "Error running terraform plan."
|
||||
exit $exit_code
|
||||
fi
|
||||
|
||||
check_demo_drift:
|
||||
runs-on: ubuntu-latest
|
||||
name: Check for drift of demo terraform configuration
|
||||
environment: demo
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: 'production'
|
||||
# check_demo_drift:
|
||||
# runs-on: ubuntu-latest
|
||||
# name: Check for drift of demo terraform configuration
|
||||
# environment: demo
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# ref: 'production'
|
||||
|
||||
# Looks like we need to install Terraform ourselves now!
|
||||
# https://github.com/actions/runner-images/issues/10796#issuecomment-2417064348
|
||||
- name: Setup Terraform
|
||||
uses: hashicorp/setup-terraform@v3
|
||||
with:
|
||||
terraform_version: "^1.7.5"
|
||||
terraform_wrapper: false
|
||||
# # Looks like we need to install Terraform ourselves now!
|
||||
# # https://github.com/actions/runner-images/issues/10796#issuecomment-2417064348
|
||||
# - name: Setup Terraform
|
||||
# uses: hashicorp/setup-terraform@v3
|
||||
# with:
|
||||
# terraform_version: "^1.7.5"
|
||||
# terraform_wrapper: false
|
||||
|
||||
- name: Check for drift
|
||||
uses: dflook/terraform-check@v1
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
||||
TF_VAR_cf_user: ${{ secrets.CLOUDGOV_USERNAME }}
|
||||
TF_VAR_cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
||||
with:
|
||||
path: terraform/demo
|
||||
# - name: Check for drift
|
||||
# uses: dflook/terraform-check@v1
|
||||
# env:
|
||||
# AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
||||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
||||
# TF_VAR_cf_user: ${{ secrets.CLOUDGOV_USERNAME }}
|
||||
# TF_VAR_cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
||||
# with:
|
||||
# path: terraform/demo
|
||||
|
||||
check_prod_drift:
|
||||
runs-on: ubuntu-latest
|
||||
name: Check for drift of production terraform configuration
|
||||
environment: production
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: 'production'
|
||||
# check_prod_drift:
|
||||
# runs-on: ubuntu-latest
|
||||
# name: Check for drift of production terraform configuration
|
||||
# environment: production
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# ref: 'production'
|
||||
|
||||
# Looks like we need to install Terraform ourselves now!
|
||||
# https://github.com/actions/runner-images/issues/10796#issuecomment-2417064348
|
||||
- name: Setup Terraform
|
||||
uses: hashicorp/setup-terraform@v3
|
||||
with:
|
||||
terraform_version: "^1.7.5"
|
||||
terraform_wrapper: false
|
||||
# # Looks like we need to install Terraform ourselves now!
|
||||
# # https://github.com/actions/runner-images/issues/10796#issuecomment-2417064348
|
||||
# - name: Setup Terraform
|
||||
# uses: hashicorp/setup-terraform@v3
|
||||
# with:
|
||||
# terraform_version: "^1.7.5"
|
||||
# terraform_wrapper: false
|
||||
|
||||
- name: Check for drift
|
||||
uses: dflook/terraform-check@v1
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
||||
TF_VAR_cf_user: ${{ secrets.CLOUDGOV_USERNAME }}
|
||||
TF_VAR_cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
||||
with:
|
||||
path: terraform/production
|
||||
# - name: Check for drift
|
||||
# uses: dflook/terraform-check@v1
|
||||
# env:
|
||||
# AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
||||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
||||
# TF_VAR_cf_user: ${{ secrets.CLOUDGOV_USERNAME }}
|
||||
# TF_VAR_cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
||||
# with:
|
||||
# path: terraform/production
|
||||
|
||||
Reference in New Issue
Block a user