Skip to content

Commit

Permalink
fix: invalid fork terraform (#5585)
Browse files Browse the repository at this point in the history
Previous fix introduced a cyclic dependency so reverting and forcing the
terraform to deploy on our script
  • Loading branch information
spypsy authored Apr 5, 2024
1 parent 46fdb37 commit 826353b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion build-system/scripts/deploy_terraform_services
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions iac/mainnet-fork/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 826353b

Please sign in to comment.