2023-07-05 10:15:05 +00:00
|
|
|
#!/bin/bash
|
2023-09-20 03:22:15 +00:00
|
|
|
# Builds and deploys a stack with only what we need.
|
|
|
|
# This script assumes we are running in the project root.
|
2023-07-05 10:15:05 +00:00
|
|
|
|
2023-09-20 03:22:15 +00:00
|
|
|
set -e
|
2023-07-05 10:15:05 +00:00
|
|
|
|
2024-04-04 14:03:25 +00:00
|
|
|
# Note: stack path should be absolute, otherwise SO looks for it in packaged stacks
|
|
|
|
laconic_so="${LACONIC_SO:-laconic-so} --stack $(readlink -f test) --verbose"
|
2023-07-05 10:15:05 +00:00
|
|
|
|
|
|
|
CONFIG_DIR=$(readlink -f "${CONFIG_DIR:-$(mktemp -d)}")
|
|
|
|
|
2023-09-20 03:22:15 +00:00
|
|
|
# Point stack-orchestrator to the multi-project root
|
|
|
|
export CERC_REPO_BASE_DIR="${CERC_REPO_BASE_DIR:-$(git rev-parse --show-toplevel)/..}"
|
2023-07-05 10:15:05 +00:00
|
|
|
|
|
|
|
# v5 migrations only go up to version 18
|
|
|
|
echo CERC_STATEDIFF_DB_GOOSE_MIN_VER=18 >> $CONFIG_DIR/stack.env
|
2024-03-28 10:08:48 +00:00
|
|
|
# don't run plugeth in the debugger
|
|
|
|
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
|
|
|
set -x
|
2023-07-05 10:15:05 +00:00
|
|
|
|
2023-09-20 03:22:15 +00:00
|
|
|
if [[ -z $SKIP_BUILD ]]; then
|
2024-03-28 10:08:48 +00:00
|
|
|
$laconic_so setup-repositories \
|
|
|
|
--exclude git.vdb.to/cerc-io/plugeth,git.vdb.to/cerc-io/plugeth-statediff
|
2023-09-20 03:22:15 +00:00
|
|
|
|
2024-03-28 10:08:48 +00:00
|
|
|
$laconic_so build-containers \
|
|
|
|
--exclude cerc/plugeth,cerc/plugeth-statediff
|
2023-09-20 03:22:15 +00:00
|
|
|
fi
|
2023-07-05 10:15:05 +00:00
|
|
|
|
|
|
|
$laconic_so deploy \
|
|
|
|
--env-file $CONFIG_DIR/stack.env \
|
2024-03-28 10:08:48 +00:00
|
|
|
--cluster test up
|