forked from visoftsolutions/noir_rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): redeploy triggers (AztecProtocol#3677)
- use `deploy_service` to restart AWS services - check if l1-contracts were redeployed to reset node file systems - redeploy l1-contracts
- Loading branch information
Showing
12 changed files
with
148 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace | ||
set -eu | ||
|
||
# This script deploys a terraform project and restarts related services. | ||
|
||
# The terraform project directory. | ||
PROJECT_DIR=$1 | ||
# Extract project name fromm the directory, e.g. yarn-project/aztec-node -> aztec-node | ||
PROJECT_NAME=$(basename $PROJECT_DIR) | ||
|
||
# The repository to check for changes. Defaults to the project name | ||
# but can be different for projects that e.g. use the sandbox image. | ||
CHECK_REBUILD_REPOSITORY=${2:-$PROJECT_NAME} | ||
|
||
# The services to restart. Defaults to the project name but can be different. | ||
SERVICE_NAMES=${3:-$PROJECT_NAME} | ||
|
||
# The terraform resources to taint. Defaults to none. | ||
TO_TAINT=${4:-} | ||
|
||
cd $PROJECT_DIR | ||
|
||
# Bail out if nothing changed. | ||
CONTENT_HASH=$(calculate_content_hash $CHECK_REBUILD_REPOSITORY) | ||
echo "Last successfully deployed commit: $CONTENT_HASH" | ||
if check_rebuild cache-$CONTENT_HASH-$DEPLOY_TAG-deployed $CHECK_REBUILD_REPOSITORY; then | ||
echo "No changes detected, skipping deployment." | ||
exit 0 | ||
fi | ||
|
||
deploy_terraform $PROJECT_NAME ./terraform/ "$TO_TAINT" | ||
|
||
# Restart services. | ||
for SERVICE in $SERVICE_NAMES; do | ||
deploy_service $SERVICE | ||
done | ||
|
||
# Tag the image as deployed. | ||
if [ "$DRY_DEPLOY" -eq 1 ]; then | ||
echo "DRY_DEPLOY: tag_remote_image $CHECK_REBUILD_REPOSITORY cache-$CONTENT_HASH cache-$CONTENT_HASH-$DEPLOY_TAG-deployed" | ||
else | ||
retry tag_remote_image $CHECK_REBUILD_REPOSITORY cache-$CONTENT_HASH cache-$CONTENT_HASH-$DEPLOY_TAG-deployed | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Append value to force redeploy | ||
1 | ||
3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters