-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "Docker compose smoke test" step
- Loading branch information
Github Action
committed
Jun 28, 2024
1 parent
939b7b5
commit 79ffaa5
Showing
5 changed files
with
120 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#! /usr/bin/env -S nix shell 'nixpkgs#docker-compose' 'nixpkgs#rsync' 'nixpkgs#jq' --command bash | ||
# shellcheck shell=bash | ||
|
||
set -euox pipefail | ||
|
||
|
||
NETWORK=preprod | ||
export NETWORK | ||
|
||
TESTS_NODE_DB="$(pwd)/state/node_db" | ||
mkdir -p "$TESTS_NODE_DB" | ||
export TESTS_NODE_DB | ||
|
||
rsync -a --delete "$NODE_STATE_DIR/db/" "$TESTS_NODE_DB" | ||
|
||
WALLET_TAG=$(buildkite-agent meta-data get "release-cabal-version") | ||
export WALLET_TAG | ||
|
||
NODE_TAG="8.9.3" | ||
export NODE_TAG | ||
|
||
NODE_DB="$TESTS_NODE_DB" | ||
export NODE_DB | ||
|
||
WALLET_DB="$(pwd)/state/wallet_db" | ||
mkdir -p "$WALLET_DB" | ||
export WALLET_DB | ||
|
||
WALLET_PORT=$(shuf -i 2000-65000 -n 1) | ||
export WALLET_PORT | ||
|
||
USER_ID=$(id -u) | ||
export USER_ID | ||
|
||
docker-compose up -d | ||
|
||
n=0 | ||
while : | ||
do | ||
result=$(curl --connect-timeout 1 localhost:$WALLET_PORT/v2/network/information || echo wait) | ||
echo $result | ||
[[ $result != "wait" ]] && break || ((n++)) | ||
(( n >= 20 )) && break | ||
done | ||
|
||
echo $result | jq | ||
|
||
mkdir -p logs | ||
docker-compose logs > logs/docker-compose.log | ||
docker-compose down |
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