2023-07-05 10:15:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-06-28 09:44:58 +00:00
|
|
|
set -ex
|
2023-07-05 10:15:05 +00:00
|
|
|
|
2024-04-13 10:36:15 +00:00
|
|
|
# Note: stack path should be absolute, otherwise SO looks for it in packaged stacks
|
2024-06-28 09:44:58 +00:00
|
|
|
stack_dir=$(readlink -f "${1:-../fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth}")
|
2023-07-05 10:15:05 +00:00
|
|
|
|
2024-06-28 09:44:58 +00:00
|
|
|
[[ -d "$stack_dir" ]]
|
2023-07-05 10:15:05 +00:00
|
|
|
|
2024-06-28 09:44:58 +00:00
|
|
|
CONFIG_DIR=$(readlink -f "${CONFIG_DIR:-$(mktemp -d)}")
|
|
|
|
# By default assume we are running in the project root.
|
2023-09-20 03:22:15 +00:00
|
|
|
export CERC_REPO_BASE_DIR="${CERC_REPO_BASE_DIR:-$(git rev-parse --show-toplevel)/..}"
|
2023-07-05 10:15:05 +00:00
|
|
|
|
2024-06-28 09:44:58 +00:00
|
|
|
laconic_so="laconic-so --verbose --stack $stack_dir"
|
|
|
|
|
|
|
|
# Don't run geth/plugeth in the debugger, it will swallow error backtraces
|
2024-04-13 10:36:15 +00:00
|
|
|
echo CERC_REMOTE_DEBUG=false >> $CONFIG_DIR/stack.env
|
2023-07-05 10:15:05 +00:00
|
|
|
|
|
|
|
|
2023-09-20 03:22:15 +00:00
|
|
|
if [[ -z $SKIP_BUILD ]]; then
|
2024-04-13 10:36:15 +00:00
|
|
|
$laconic_so setup-repositories \
|
2024-05-29 09:47:09 +00:00
|
|
|
--exclude git.vdb.to/cerc-io/plugeth-statediff
|
|
|
|
# Assume the tested image has been built separately
|
2024-04-13 10:36:15 +00:00
|
|
|
$laconic_so build-containers \
|
2024-05-29 09:47:09 +00:00
|
|
|
--exclude cerc/plugeth-statediff
|
2024-07-09 02:19:39 +00:00
|
|
|
else
|
|
|
|
registry="gitea.local:5555"
|
|
|
|
|
|
|
|
$laconic_so fetch-containers \
|
|
|
|
--exclude cerc/plugeth,cerc/plugeth-statediff \
|
|
|
|
--image-registry $registry
|
2023-09-20 03:22:15 +00:00
|
|
|
fi
|
2023-07-05 10:15:05 +00:00
|
|
|
|
2024-06-28 09:44:58 +00:00
|
|
|
if ! $laconic_so deploy \
|
|
|
|
--env-file $CONFIG_DIR/stack.env \
|
|
|
|
--cluster test up
|
|
|
|
then
|
|
|
|
$laconic_so deploy --cluster test logs
|
|
|
|
exit 1
|
|
|
|
fi
|