Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions files/makefile-cpu-arch.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dist-dev: check-arch ## Build docker container (intended for developer-based man
docker buildx use $(ECR_NAME_DEV); \
docker buildx build --platform $(CPU_ARCH) \
--load \
--tag $(ECR_URL_DEV):$$ARCH_TAG \
--tag $(ECR_URL_DEV):make-$$ARCH_TAG \
--tag $(ECR_URL_DEV):make-$(shell git describe --always) \
--tag $(ECR_NAME_DEV):$$ARCH_TAG \
Expand All @@ -34,9 +35,11 @@ dist-dev: check-arch ## Build docker container (intended for developer-based man
publish-dev: dist-dev ## Build, tag and push (intended for developer-based manual publish)
@ARCH_TAG=$$(cat .arch_tag); \
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $(ECR_URL_DEV); \
docker push $(ECR_URL_DEV):$$ARCH_TAG; \
docker push $(ECR_URL_DEV):make-$$ARCH_TAG; \
docker push $(ECR_URL_DEV):make-$(shell git describe --always); \
docker push $(ECR_URL_DEV):make-$(shell echo $(CPU_ARCH) | cut -d'/' -f2)
echo "Cleaning up dangling Docker images..."; \
docker image prune -f --filter "dangling=true"

### If this is a Lambda repo, uncomment the two lines below ###
# update-lambda-dev: ## Updates the lambda with whatever is the most recent image in the ecr (intended for developer-based manual update)
Expand All @@ -49,9 +52,9 @@ publish-dev: dist-dev ## Build, tag and push (intended for developer-based manua
docker-clean: ## Clean up Docker detritus
@ARCH_TAG=$$(cat .arch_tag); \
echo "Cleaning up Docker leftovers (containers, images, builders)"; \
docker rmi -f $(ECR_URL_DEV):$$ARCH_TAG; \
docker rmi -f $(ECR_URL_DEV):make-$$ARCH_TAG; \
docker rmi -f $(ECR_URL_DEV):make-$(shell git describe --always) || true; \
docker rmi -f $(ECR_URL_DEV):make-$(shell echo $(CPU_ARCH) | cut -d'/' -f2) || true; \
docker rmi -f $(ECR_NAME_DEV):$$ARCH_TAG || true; \
docker buildx rm $(ECR_NAME_DEV) || true
@rm -rf .arch_tag
37 changes: 8 additions & 29 deletions timdex_ecrs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,10 @@ module "ecr_timdex_browsertrix" {
app-repo = "timdex-infrastructure-browsertrix"
}
}
# NEED TO FIX THE MISSPELLING!!!
moved {
from = module.ecr_timdex_broswertrix
to = module.ecr_timdex_browsertrix
}

# Outputs in dev
output "browsertrix_dev_build_workflow" {
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build.tpl", {
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/dev-build-cpu-arch.tpl", {
region = var.aws_region
role = module.ecr_timdex_browsertrix.gha_role
ecr = module.ecr_timdex_browsertrix.repository_name
Expand All @@ -274,28 +270,20 @@ output "browsertrix_dev_build_workflow" {
)
description = "Full contents of the dev-build.yml for the browsertrix-harvester repo"
}
# NEED TO FIX THE MISSPELLING!!!
moved {
from = output.broswertrix_dev_build_workflow
to = output.browsertrix_dev_build_workflow
}

output "browsertrix_makefile" {
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile.tpl", {
value = var.environment == "prod" || var.environment == "stage" ? null : templatefile("${path.module}/files/makefile-cpu-arch.tpl", {
ecr_name = module.ecr_timdex_browsertrix.repository_name
ecr_url = module.ecr_timdex_browsertrix.repository_url
function = ""
}
)
description = "Full contents of the Makefile for the browsertrix-harvester repo (allows devs to push to Dev account only)"
}
# NEED TO FIX THE MISSPELLING!!!
moved {
from = output.broswertrix_makefile
to = output.browsertrix_makefile
}

# Outputs in stage
output "browsertrix_stage_build_workflow" {
value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build.tpl", {
value = var.environment == "prod" || var.environment == "dev" ? null : templatefile("${path.module}/files/stage-build-cpu-arch.tpl", {
region = var.aws_region
role = module.ecr_timdex_browsertrix.gha_role
ecr = module.ecr_timdex_browsertrix.repository_name
Expand All @@ -304,14 +292,10 @@ output "browsertrix_stage_build_workflow" {
)
description = "Full contents of the stage-build.yml for the browsertrix-harvester repo"
}
# NEED TO FIX THE MISSPELLING!!!
moved {
from = output.broswertrix_stage_build_workflow
to = output.browsertrix_stage_build_workflow
}

# Outputs after promotion to prod
output "browsertrix_prod_promote_workflow" {
value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote.tpl", {
value = var.environment == "stage" || var.environment == "dev" ? null : templatefile("${path.module}/files/prod-promote-cpu-arch.tpl", {
region = var.aws_region
role_stage = "${module.ecr_timdex_browsertrix.repo_name}-gha-stage"
role_prod = "${module.ecr_timdex_browsertrix.repo_name}-gha-prod"
Expand All @@ -322,11 +306,6 @@ output "browsertrix_prod_promote_workflow" {
)
description = "Full contents of the prod-promote.yml for the browsertrix-harvester repo"
}
# NEED TO FIX THE MISSPELLING!!!
moved {
from = output.broswertrix_prod_promote_workflow
to = output.browsertrix_prod_promote_workflow
}


## geo-harvester
Expand Down