Skip to content

Commit

Permalink
feat: create envs using terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Sep 2, 2024
1 parent 7cc8f9d commit 6c94bac
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions terraform/resources-environments.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {
for_each = {for k, v in var.repositories : k => v if v.is_django_commons_repo == false}

id = "${each.key}:pypi"
to = github_repository_environment.pypi[each.key]
}

resource "github_repository_environment" "pypi" {
for_each = {for k, v in var.repositories : k => v if v.is_django_commons_repo == false}

environment = "pypi"
repository = each.key
prevent_self_review = true
reviewers {
teams = [github_team.repo_admin_team[each.key].id]
}
deployment_branch_policy {
protected_branches = false
custom_branch_policies = false
}
}

resource "github_repository_environment" "testpypi" {
for_each = {for k, v in var.repositories : k => v if v.is_django_commons_repo == false}

environment = "testpypi"
repository = each.key
prevent_self_review = true

deployment_branch_policy {
protected_branches = false
custom_branch_policies = false
}
}

0 comments on commit 6c94bac

Please sign in to comment.