diff --git a/.circleci/config.yml b/.circleci/config.yml index bc2958989a1..3fe7d604c70 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1186,7 +1186,7 @@ jobs: name: "Deploy mainnet fork" command: | should_deploy || exit 0 - deploy_terraform_services iac/mainnet-fork + deploy_terraform_services iac/mainnet-fork mainnet-fork mainnet-fork aws_efs_file_system.aztec_mainnet_fork_data_store - run: name: "Release canary to NPM: bb.js" command: | @@ -1244,7 +1244,7 @@ jobs: # Check if l1-contracts have changed if [ "$CONTRACTS_DEPLOYED" -eq 1 ]; then echo "Contracts have changed, taint nodes to force redeploy.." - deploy_terraform_services yarn-project/aztec-node aztec aztec-node "aws_ecs_task_definition.aztec-node[0],aws_ecs_task_definition.aztec-node[1]" + deploy_terraform_services yarn-project/aztec-node aztec aztec-node "aws_ecs_task_definition.aztec-node[0],aws_ecs_task_definition.aztec-node[1]" 1 else deploy_terraform_services yarn-project/aztec-node aztec fi diff --git a/build-system/scripts/deploy_terraform_services b/build-system/scripts/deploy_terraform_services index 7ae1bfa4ec2..f3518263589 100755 --- a/build-system/scripts/deploy_terraform_services +++ b/build-system/scripts/deploy_terraform_services @@ -19,12 +19,15 @@ SERVICE_NAMES=${3:-$PROJECT_NAME} # The terraform resources to taint. Defaults to none. TO_TAINT=${4:-} +# Flag to force a deployment even if no changes are detected. +FORCE_DEPLOY=${5:-} + cd $PROJECT_DIR # Bail out if nothing changed. CONTENT_HASH=$(calculate_content_hash $CHECK_REBUILD_REPOSITORY) echo "Last successfully deployed commit: $CONTENT_HASH" -if [ -z "$TO_TAINT" ] && check_rebuild cache-$CONTENT_HASH-$DEPLOY_TAG-deployed $CHECK_REBUILD_REPOSITORY; then +if [ -z "$FORCE_DEPLOY" ] && check_rebuild cache-$CONTENT_HASH-$DEPLOY_TAG-deployed $CHECK_REBUILD_REPOSITORY; then echo "No changes detected, skipping deployment." exit 0 fi diff --git a/iac/mainnet-fork/terraform/main.tf b/iac/mainnet-fork/terraform/main.tf index e8978b48120..74497ecc2cf 100644 --- a/iac/mainnet-fork/terraform/main.tf +++ b/iac/mainnet-fork/terraform/main.tf @@ -77,8 +77,7 @@ resource "aws_efs_file_system" "aztec_mainnet_fork_data_store" { creation_token = "${var.DEPLOY_TAG}-mainnet-fork-data" tags = { - Name = "${var.DEPLOY_TAG}-mainnet-fork-data" - TaskDefinitionArn = "${aws_ecs_task_definition.aztec_mainnet_fork.arn}" # This line forces recreation on task definition change + Name = "${var.DEPLOY_TAG}-mainnet-fork-data" } lifecycle_policy {