Skip to content

Commit

Permalink
Merge pull request #13 from develeap/feature/digger
Browse files Browse the repository at this point in the history
Feature/digger
  • Loading branch information
zMynxx authored Apr 1, 2024
2 parents 0718627 + 72b3338 commit 37290ab
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 25 deletions.
38 changes: 17 additions & 21 deletions .github/workflows/digger_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: Digger Pull Request Workflow
on:
workflow_dispatch:
Expand Down Expand Up @@ -26,10 +25,10 @@ jobs:
runs-on: ubuntu-latest
# Permissions for OIDC with AWS
permissions:
contents: write # required to merge PRs
id-token: write # required for workload-identity-federation
pull-requests: write # required to post PR comments
statuses: write # required to validate combined PR status
contents: write # required to merge PRs
id-token: write # required for workload-identity-federation
pull-requests: write # required to post PR comments
statuses: write # required to validate combined PR status
steps:
- name: Setup Infracost
uses: infracost/actions/setup@v3
Expand All @@ -53,14 +52,12 @@ jobs:
# AWS Settings #
#################
setup-aws: true
aws-role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/${{ secrets.ROLE_NAME
}}
aws-role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/${{ secrets.ROLE_NAME }}
aws-region: ${{ secrets.AWS_REGION }}
####################
# Digger Settings #
####################
configure-checkout: true
telemetry: false
disable-locking: true
digger-filename: digger.yaml
digger-hostname: https://cloud.digger.dev
Expand All @@ -76,16 +73,15 @@ jobs:
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# DIGGER_ACCESS_KEY_ID: ${{ secrets.DIGGER_ACCESS_KEY_ID }}
# DIGGER_SECRET_ACCESS_KEY: ${{ secrets.DIGGER_SECRET_ACCESS_KEY }}

##########
# DEBUG #
##########
# In order to debug the generation of the provider and backend files, uncomment the following lines
# - name: check provider.tf
# if: always()
# run: cat infrastructure-live/01234567890/prod/prod-1/il-central-1/compute/demo-ec2/.terragrunt-cache/*/*/provider.tf
# shell: bash
# - name: check backend.tf
# if: always()
# run: cat infrastructure-live/01234567890/prod/prod-1/il-central-1/compute/demo-ec2/.terragrunt-cache/*/*/backend.tf
# shell: bash
##########
# DEBUG #
##########
# In order to debug the generation of the provider and backend files, uncomment the following lines
# - name: check provider.tf
# if: always()
# run: cat infrastructure-live/01234567890/prod/prod-1/il-central-1/compute/demo-ec2/.terragrunt-cache/*/*/provider.tf
# shell: bash
# - name: check backend.tf
# if: always()
# run: cat infrastructure-live/01234567890/prod/prod-1/il-central-1/compute/demo-ec2/.terragrunt-cache/*/*/backend.tf
# shell: bash
1 change: 0 additions & 1 deletion .github/workflows/drift-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
# Digger Settings #
####################
configure-checkout: true
telemetry: false
disable-locking: true
digger-filename: digger.yaml
digger-hostname: https://cloud.digger.dev
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/manual-destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
# Digger Settings #
####################
configure-checkout: true
telemetry: false
disable-locking: true
digger-filename: digger.yaml
digger-hostname: https://cloud.digger.dev
Expand Down
2 changes: 1 addition & 1 deletion digger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ generate_projects:
createProjectName: true
createWorkspace: true
defaultWorkflow: default
telemetry: false
workflows:
# To be run on every pull request, by default
default:
Expand All @@ -23,7 +24,6 @@ workflows:
- run: infracost breakdown --path=. | tee -a $DIGGER_OUT
- run: git checkout $DEFAULT_BRANCH && infracost breakdown --path . --format=json --out-file=$RUNNER_TEMP/infracost-base-${PROJECT_NAME}.json && git fetch origin $PR_BRANCH && git checkout $PR_BRANCH
- run: infracost diff --path=. --compare-to=$RUNNER_TEMP/infracost-base-${PROJECT_NAME}.json | tee -a $DIGGER_OUT

# To be run on only by invoking the /digger commands in a PR
# comments-only:
# apply:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ inputs = merge(
local.commons.locals,
{
# Override the instance type and AMI for this specific component and environment.
instance_name = "${include.provider.locals.env}.demo.ec2"
name = "${include.provider.locals.env}.demo.ec2"
}
)

0 comments on commit 37290ab

Please sign in to comment.