-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
frudisch
committed
Oct 7, 2024
1 parent
cbf1c75
commit 2606228
Showing
5 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CI & Plan | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
# The permissions are necessary for the google-github-actions/auth@v2 action | ||
permissions: | ||
contents: read | ||
id-token: write | ||
runs-on: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: google-github-actions/auth@v2 | ||
with: | ||
project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
workload_identity_provider: ${{ secrets.STATE_BUCKET_ACCESS_WIF_PROVIDER }} | ||
service_account: ${{ secrets.STATE_SERVICE_ACCOUNT_ID }} | ||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v2 | ||
- name: Which user am I ? | ||
run: gcloud config list account --format "value(core.account)" | ||
- uses: hashicorp/setup-terraform@v3 | ||
- name: Use gcloud CLI | ||
run: | | ||
gcloud info | ||
curl -H "X-Goog-User-Project: vbdev-436712" -H "Authorization: Bearer $(gcloud auth print-access-token)" "https://storage.googleapis.com/storage/v1/b/lpt-schulung-bucket-tfstate/o?alt=json&delimiter=%2F&endOffset=&includeTrailingDelimiter=false&pageToken=&prefix=bootstrap%2F&prettyPrint=false&projection=full&startOffset=&versions=false" | ||
- id: init | ||
env: | ||
TF_VAR_github_token: ${{ secrets.API_ACCESS_TOKEN }} | ||
TF_VAR_project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
TF_IN_AUTOMATION: 'true' | ||
run: | | ||
terraform init -input=false | ||
- id: plan | ||
run: terraform plan -no-color | ||
- run: echo ${{ steps.plan.outputs.stdout }} | ||
- run: echo ${{ steps.plan.outputs.stderr }} | ||
- run: echo ${{ steps.plan.outputs.exitcode }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module "github_wif" { | ||
source = "Cyclenerd/wif-github/google" | ||
version = "~> 1.0.0" | ||
project_id = var.project_id | ||
attribute_condition = "assertion.repository_owner == 'senacor'" | ||
} | ||
|
||
module "wif_lpt_bootstrap" { | ||
source = "Cyclenerd/wif-service-account/google" | ||
version = "~> 1.0.0" | ||
project_id = var.project_id | ||
pool_name = module.github_wif.pool_name | ||
account_id = module.state_service_account.id | ||
repository = github_repository.bootstrap.full_name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters