Skip to content

Commit 94143cd

Browse files
authored
Merge pull request #67 from MITLibraries/dev
Dev-to-Stage: Test Repo for New Shared Workflows
2 parents 5859d87 + 530e3f2 commit 94143cd

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ This is a core infrastructure repository that defines infrastructure related to
186186
| ecr\_timdex\_transmogrifier | ./modules/ecr | n/a |
187187
| ecr\_wcd2reshare | ./modules/ecr | n/a |
188188
| ecr\_wiley | ./modules/ecr | n/a |
189+
| ecr\_workflowtest | ./modules/ecr | n/a |
189190

190191
## Resources
191192

@@ -320,4 +321,8 @@ This is a core infrastructure repository that defines infrastructure related to
320321
| wiley\_fargate\_makefile | Full contents of the Makefile for the wiley-deposits repo (allows devs to push to Dev account only) |
321322
| wiley\_fargate\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the wiley-deposits repo |
322323
| wiley\_fargate\_stage\_build\_workflow | Full contents of the stage-build.yml for the wiley-deposits repo |
324+
| workflowtest\_dev\_build\_workflow | Full contents of the dev-build.yml for the ecr-workflow-test repo |
325+
| workflowtest\_makefile | Full contents of the Makefile for the ecr-workflow-test repo (allows devs to push to Dev account only) |
326+
| workflowtest\_prod\_promote\_workflow | Full contents of the prod-promote.yml for the ecr-workflow-test repo |
327+
| workflowtest\_stage\_build\_workflow | Full contents of the stage-build.yml for the ecr-workflow-test repo |
323328
<!-- END_TF_DOCS -->

ect_workflow_text_ecr.tf

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
# ecr-workflow-test containers
3+
# This is a standard ECR for an ECS with a Fargate launch type
4+
locals {
5+
ecr_workflowtest = "workflowtest-${var.environment}"
6+
}
7+
module "ecr_workflowtest" {
8+
source = "./modules/ecr"
9+
repo_name = "ecr-workflow-test"
10+
login_policy_arn = aws_iam_policy.login.arn
11+
oidc_arn = data.aws_ssm_parameter.oidc_arn.value
12+
environment = var.environment
13+
tfoutput_ssm_path = var.tfoutput_ssm_path
14+
tags = {
15+
app-repo = "ecr-workflow-test"
16+
}
17+
}
18+
19+
20+
## Outputs to Terraform Cloud for devs ##
21+
22+
## For workflowtest application repo and ECR repository
23+
# Outputs in dev
24+
output "workflowtest_dev_build_workflow" {
25+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", {
26+
region = var.aws_region
27+
role = module.ecr_workflowtest.gha_role
28+
ecr = module.ecr_workflowtest.repository_name
29+
function = ""
30+
}
31+
)
32+
description = "Full contents of the dev-build.yml for the ecr-workflow-test repo"
33+
}
34+
output "workflowtest_makefile" {
35+
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", {
36+
ecr_name = module.ecr_workflowtest.repository_name
37+
ecr_url = module.ecr_workflowtest.repository_url
38+
function = ""
39+
}
40+
)
41+
description = "Full contents of the Makefile for the ecr-workflow-test repo (allows devs to push to Dev account only)"
42+
}
43+
44+
# Outputs in stage
45+
output "workflowtest_stage_build_workflow" {
46+
value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", {
47+
region = var.aws_region
48+
role = module.ecr_workflowtest.gha_role
49+
ecr = module.ecr_workflowtest.repository_name
50+
function = ""
51+
}
52+
)
53+
description = "Full contents of the stage-build.yml for the ecr-workflow-test repo"
54+
}
55+
56+
# Outputs after promotion to prod
57+
output "workflowtest_prod_promote_workflow" {
58+
value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", {
59+
region = var.aws_region
60+
role_stage = "${module.ecr_workflowtest.repo_name}-gha-stage"
61+
role_prod = "${module.ecr_workflowtest.repo_name}-gha-prod"
62+
ecr_stage = "${module.ecr_workflowtest.repo_name}-stage"
63+
ecr_prod = "${module.ecr_workflowtest.repo_name}-prod"
64+
function = ""
65+
}
66+
)
67+
description = "Full contents of the prod-promote.yml for the ecr-workflow-test repo"
68+
}

0 commit comments

Comments
 (0)