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
12 changes: 8 additions & 4 deletions deploy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ else
endif

ECR_URI=$(TF_VAR_allowed_account_id).dkr.ecr.us-west-2.amazonaws.com
REPLICATED_ECR_URI=$(TF_VAR_allowed_account_id).dkr.ecr.$(TF_VAR_region).amazonaws.com
IMAGE_TAG_BASE=$(ECR_URI)/$(TF_VAR_app)-ecr:$(TF_WORKSPACE)
REPLICATED_IMAGE_TAG_BASE=$(REPLICATED_ECR_URI)/$(TF_VAR_app)-ecr:$(TF_WORKSPACE)

# This is a hack to eval the image tag only when it's a dependency, cause we don't want to set it until docker builds
get_image_tag = IMAGE_TAG = $$(IMAGE_TAG_BASE)-$$(shell docker inspect --format $$(format-filter) $$(IMAGE_TAG_BASE)-latest | sed -e 's/sha256://g')
get_replicated_image_tag = REPLICATED_IMAGE_TAG = $$(REPLICATED_IMAGE_TAG_BASE)-$$(shell docker inspect --format $$(format-filter) $$(IMAGE_TAG_BASE)-latest | sed -e 's/sha256://g')

.PHONY: eval_image_tag

eval_image_tag:
$(eval $(get_image_tag))
$(eval $(get_replicated_image_tag))

# GET the absolute location for .env.production.local, again, only after it exists

Expand Down Expand Up @@ -60,7 +64,7 @@ docker-push: docker-tag eval_image_tag
.PHONY: clean-terraform

clean-terraform: eval_image_tag
tofu -chdir=app destroy -var="image_tag=$(IMAGE_TAG)"
tofu -chdir=app destroy -var="image_tag=$(REPLICATED_IMAGE_TAG)"

.PHONY: clean-shared

Expand Down Expand Up @@ -120,7 +124,7 @@ plan-shared: shared/.terraform
.PHONY: plan-app

plan-app: app/.terraform .tfworkspace eval_image_tag eval_env_file eval_ingest_env_file
tofu -chdir=app plan -var="image_tag=$(IMAGE_TAG)" -var='env_files=["$(ENV_FILE)"]' -var='ingest_env_files=["$(INGEST_ENV_FILE)"]'
tofu -chdir=app plan -var="image_tag=$(REPLICATED_IMAGE_TAG)" -var='env_files=["$(ENV_FILE)"]' -var='ingest_env_files=["$(INGEST_ENV_FILE)"]'

.PHONY: plan

Expand All @@ -139,7 +143,7 @@ apply-shared: shared/.terraform
.PHONY: apply-app

apply-app: app/.terraform .tfworkspace docker-push eval_image_tag eval_env_file eval_ingest_env_file
tofu -chdir=app apply -var="image_tag=$(IMAGE_TAG)" -var='env_files=["$(ENV_FILE)"]' -var='ingest_env_files=["$(INGEST_ENV_FILE)"]' $(APPLY_ARGS)
tofu -chdir=app apply -var="image_tag=$(REPLICATED_IMAGE_TAG)" -var='env_files=["$(ENV_FILE)"]' -var='ingest_env_files=["$(INGEST_ENV_FILE)"]' $(APPLY_ARGS)

.PHONY: apply
apply: apply-shared apply-app
Expand All @@ -150,7 +154,7 @@ console-shared: shared/.terraform

.PHONY: console
console: app/.terraform .tfworkspace eval_image_tag eval_env_file eval_ingest_env_file
tofu -chdir=app console -var="image_tag=$(IMAGE_TAG)" -var='env_files=["$(ENV_FILE)"]' -var='ingest_env_files=["$(INGEST_ENV_FILE)"]'
tofu -chdir=app console -var="image_tag=$(REPLICATED_IMAGE_TAG)" -var='env_files=["$(ENV_FILE)"]' -var='ingest_env_files=["$(INGEST_ENV_FILE)"]'

.PHONY: wait-deploy
wait-deploy:
Expand Down
2 changes: 1 addition & 1 deletion deploy/app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ provider "aws" {
}

module "app" {
source = "github.com/storacha/storoku//app?ref=v0.2.43"
source = "github.com/storacha/storoku//app?ref=v0.2.44"
private_key = var.private_key
private_key_env_var = "STORETHEINDEX_PRIV_KEY"
httpport = 3000
Expand Down
4 changes: 2 additions & 2 deletions deploy/shared/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ provider "aws" {
}

module "shared" {
source = "github.com/storacha/storoku//shared?ref=v0.2.43"
source = "github.com/storacha/storoku//shared?ref=v0.2.44"
create_db = false
caches = []
networks = ["warm"]
networks = ["warm",]
app = var.app
zone_id = var.cloudflare_zone_id
domain_base = var.domain_base
Expand Down