Skip to content

Commit

Permalink
Cleanup database dirs when smoke testing the wallet in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Aug 1, 2024
1 parent 935c556 commit e6a3765
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ steps:
env:
NODE_LOGS_FILE: ./logs/node.log
WALLET_LOGS_FILE: ./logs/wallet.log
CLEANUP_DB: true

- label: Mainnet Boot Sync
depends_on: linux-nix
Expand All @@ -176,6 +177,7 @@ steps:
SUCCESS_STATUS: syncing
NODE_LOGS_FILE: ./logs/node.log
WALLET_LOGS_FILE: ./logs/wallet.log
CLEANUP_DB: true

- block: Sanchonet Full Sync
if: build.env("RELEASE_CANDIDATE") == null
Expand All @@ -199,6 +201,7 @@ steps:
env:
NODE_LOGS_FILE: ./logs/node.log
WALLET_LOGS_FILE: ./logs/wallet.log
CLEANUP_DB: true

- block: Preprod Full Sync
if: build.env("RELEASE_CANDIDATE") == null
Expand All @@ -224,6 +227,7 @@ steps:
env:
NODE_LOGS_FILE: ./logs/node.log
WALLET_LOGS_FILE: ./logs/wallet.log
CLEANUP_DB: true


- group: Code Quality Checks
Expand Down
10 changes: 10 additions & 0 deletions run/common/nix/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ if [[ -z "${WALLET_DB-}" ]]; then
export WALLET_DB
fi

if [[ -n "${CLEANUP_DB-}" ]]; then
rm -rf "${WALLET_DB:?}"/*
fi

# Define a local db if NODE_DB is not set
if [[ -z "${NODE_DB-}" ]]; then
LOCAL_NODE_DB=./databases/node-db
Expand All @@ -36,6 +40,10 @@ if [[ -z "${NODE_DB-}" ]]; then
export NODE_DB
fi

if [[ -n "${CLEANUP_DB-}" ]]; then
rm -rf "${NODE_DB:?}"/*
fi

# Define and export the node socket name
NODE_SOCKET_NAME=node.socket

Expand Down Expand Up @@ -64,6 +72,8 @@ cardano-node run \
+RTS -N -A16m -qg -qb -RTS 1>$NODE_LOGS_FILE 2>$NODE_LOGS_FILE &
NODE_ID=$!

echo "Node id: $NODE_ID"

# Define the wallet logs file
LOCAL_WALLET_LOGS_FILE=./wallet.log
WALLET_LOGS_FILE="${WALLET_LOGS_FILE:=$LOCAL_WALLET_LOGS_FILE}"
Expand Down

0 comments on commit e6a3765

Please sign in to comment.