-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- [x] Add docker build image step to main pipeline for all pushes - [x] Add docker compose smoke test and docker push steps for release candidate push ADP-3368
- Loading branch information
Showing
4 changed files
with
150 additions
and
22 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,16 @@ | ||
#! /usr/bin/env -S nix shell --command bash | ||
# shellcheck shell=bash | ||
|
||
set -euox pipefail | ||
|
||
git fetch --all | ||
|
||
RELEASE_CANDIDATE_COMMIT=$(buildkite-agent meta-data get "release-candidate-commit" --default="${BUILDKITE_COMMIT}") | ||
|
||
git checkout "$RELEASE_CANDIDATE_COMMIT" | ||
|
||
mkdir -p result | ||
|
||
nix build .#dockerImage -o result/docker-image | ||
|
||
docker load < result/docker-image |
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,78 @@ | ||
#! /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.4" | ||
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 | ||
|
||
tmpfile=$(mktemp -d /tmp/node-preprod.XXXXXX) | ||
|
||
# set the node socket path | ||
NODE_SOCKET_DIR="$tmpfile" | ||
export NODE_SOCKET_DIR | ||
|
||
NODE_SOCKET_NAME="node.socket" | ||
export NODE_SOCKET_NAME | ||
|
||
COMPOSE_PROJECT_NAME="docker-smoke-test-$WALLET_PORT" | ||
export COMPOSE_PROJECT_NAME | ||
|
||
docker compose down || true | ||
|
||
docker-compose up -d | ||
|
||
n=0 | ||
while : | ||
do | ||
result=$(curl --connect-timeout 1 localhost:"$WALLET_PORT"/v2/network/information || echo "wait") | ||
echo "$result" | ||
if [ "$result" != "wait" ]; | ||
then | ||
echo "$result" | jq | ||
break | ||
else | ||
sleep 30 | ||
n=$((n+1)) | ||
fi | ||
done | ||
|
||
|
||
mkdir -p logs | ||
docker-compose logs > logs/docker-compose.log | ||
docker-compose down | ||
|
||
rm -rf "$tmpfile" | ||
|
||
if [ "$result" == "wait" ]; | ||
then | ||
echo "Failed to start the wallet server" | ||
exit 1 | ||
fi |