Skip to content

Commit

Permalink
initial add
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed Aug 14, 2024
1 parent 2eea940 commit c44b94c
Show file tree
Hide file tree
Showing 4 changed files with 3,322 additions and 66 deletions.
7 changes: 7 additions & 0 deletions external_actions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module github_script {
source = "HappyPathway/gh-actions/importer"
git_repo_url = "https://github.com/actions/github-script.git"
git_repo_path = "/home/a/arnol377/git/gh-actions-github-script"
repo_name = "gh-actions-github-script"
repo_org = "CSVD"
}
77 changes: 70 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,80 @@
module "runner" {
source = "HappyPathway/runner/ghe"
github_base_url = "https://github.e.it.census.gov"
github_owner = "CSVD"
runner_basedir = "/apps/terraform/workspaces/arnol377/ghe-runner"
runner_tarball = "/apps/terraform/workspaces/arnol377/actions-runner-linux-x64-2.304.0.tar.gz"
repos = [

locals {
pipeline_repos = [
"aws-image-pipeline",
"linux-image-pipeline",
"windows-image-pipeline",
"image-pipeline-goss-testing",
"image-pipeline-ansible-playbooks",
]
workspace_repos = [
"automation-repos"
]
all_repos = concat(
local.pipeline_repos,
local.workspace_repos
)
secrets = [
"AWS_SECRET_ACCESS_KEY",
"AWS_SESSION_TOKEN",
"AWS_ACCESS_KEY_ID",
"GITHUB_TOKEN"
]
}

module "runner" {
source = "HappyPathway/runner/ghe"
github_base_url = "https://github.e.it.census.gov"
github_owner = "CSVD"
runner_basedir = "/apps/terraform/workspaces/arnol377/ghe-runner"
runner_tarball = "/apps/terraform/workspaces/arnol377/actions-runner-linux-x64-2.304.0.tar.gz"
repos = local.pipeline_repos
runner_labels = [
"image-pipeline"
]
}

module "tf_workspace_runners" {
source = "HappyPathway/runner/ghe"
github_base_url = "https://github.e.it.census.gov"
github_owner = "CSVD"
runner_basedir = "/apps/terraform/workspaces/arnol377/ghe-runner"
runner_tarball = "/apps/terraform/workspaces/arnol377/actions-runner-linux-x64-2.304.0.tar.gz"
repos = local.workspace_repos
runner_labels = [
"terraform-workspaces"
]
}

module env_var {
source = "HappyPathway/var/env"
for_each = toset(local.secrets)
env_var = each.value
}

module repo_secrets {
source = "HappyPathway/vars/repo"
for_each = toset(local.all_repos)
repo = {
name = each.value
}
secrets = [
for secret in [for secret in local.secrets : secret if secret != "AWS_ACCESS_KEY_ID"]:
{
name = replace(secret, "GITHUB", "GH")
value = lookup(module.env_var, secret).value
}
]
vars = [
{
name = "AWS_ACCESS_KEY_ID"
value = lookup(module.env_var, "AWS_ACCESS_KEY_ID").value
}
]

}


output secrets {
value = module.env_var
}
Loading

0 comments on commit c44b94c

Please sign in to comment.