Skip to content

Commit

Permalink
adding config + pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorOKane-Kainos committed Jul 4, 2024
1 parent a1ecd2a commit e14f702
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions components/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@
# }

locals {
# Read the repositories from the JSON file
repositories_json = file("${path.module}./test-repos.json")
repositories_data = jsondecode(local.repositories_json)
# Read the repositories list from the JSON file
repositories_list = jsondecode(file("${path.module}/test-repos.json"))

# Create combinations of repositories and branches
# Filter out excluded repositories using a function instead of inline comprehension
included_repositories = [
for repo in local.repositories_list : repo
if !contains(var.excluded_repositories, repo)
]

# Create a combination of repositories and branches
repo_branch_combinations = flatten([
for repo in local.repositories_data : [
for repo in local.included_repositories : [
for branch in var.branches : {
repo = repo
branch = branch
Expand All @@ -32,6 +37,11 @@ locals {
])
}






locals {
env_display_names = {
sbox = "Sandbox"
Expand Down

0 comments on commit e14f702

Please sign in to comment.