forked from NethermindEth/juno
-
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.
Add waiting for deployment step in CI pipeline (NethermindEth#1810)
- Loading branch information
1 parent
4d43a8a
commit bde35d8
Showing
2 changed files
with
32 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
URL=$1 | ||
EXPECTED_VERSION=$2 | ||
MAX_ATTEMPTS=30 | ||
SLEEP_DURATION=10 | ||
|
||
for i in $(seq 1 $MAX_ATTEMPTS); do | ||
DEPLOYED_VERSION=$(curl -s -X POST "$URL" -H "Content-Type: application/json" -d '{"method": "juno_version", "jsonrpc": "2.0", "id": 0}' | jq -r '.result') | ||
echo "Attempt $i: Deployed version $DEPLOYED_VERSION" | ||
if [[ "$DEPLOYED_VERSION" == "$EXPECTED_VERSION" ]]; then | ||
echo "Deployment version matches the image tag." | ||
exit 0 | ||
fi | ||
sleep $SLEEP_DURATION | ||
done | ||
|
||
echo "Deployment version did not match the image tag within the expected time frame." | ||
exit 1 |
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