diff --git a/Makefile b/Makefile index 7a707485..71517ebc 100644 --- a/Makefile +++ b/Makefile @@ -32,10 +32,12 @@ build-all: build-image @bash -x src/scripts/build.sh run-query-agent: - @bash -x src/scripts/run.sh query_broker 31700 + @PORT=$$(bash src/scripts/gkctl_auto_join_and_reserve.sh | tail -n 1); \ + bash -x src/scripts/run.sh query_broker $$PORT run-attention-broker: - @bash -x src/scripts/run.sh attention_broker_service 37007 + @PORT=$$(bash src/scripts/gkctl_auto_join_and_reserve.sh | tail -n 1); \ + bash -x src/scripts/run.sh attention_broker_service $$PORT run-link-creation-agent: @bash -x src/scripts/run.sh link_creation_server $(OPTIONS) diff --git a/scripts/deployment/hooks/custom/das-toolbox-before-release.sh b/scripts/deployment/hooks/custom/das-toolbox-before-release.sh index a08dca1e..50fdce83 100644 --- a/scripts/deployment/hooks/custom/das-toolbox-before-release.sh +++ b/scripts/deployment/hooks/custom/das-toolbox-before-release.sh @@ -2,7 +2,7 @@ set -e -local file_path="src/config/config.py" +local file_path="das-cli/src/settings/config.py" if [ -f "$file_path" ]; then sed_inplace "s/^VERSION = .*/VERSION = '$new_package_version'/g" "$file_path" diff --git a/scripts/deployment/hooks/custom/das-toolbox-dependency-check.sh b/scripts/deployment/hooks/custom/das-toolbox-dependency-check.sh index 208221ed..8051983b 100644 --- a/scripts/deployment/hooks/custom/das-toolbox-dependency-check.sh +++ b/scripts/deployment/hooks/custom/das-toolbox-dependency-check.sh @@ -2,7 +2,7 @@ set -e -local config_file_path="src/config/config.py" +local config_file_path="das-cli/src/settings/config.py" if ! source "$hooks_path/common/dependency-check.sh"; then return 0 diff --git a/src/scripts/gkctl_auto_join_and_reserve.sh b/src/scripts/gkctl_auto_join_and_reserve.sh new file mode 100755 index 00000000..e105fb4b --- /dev/null +++ b/src/scripts/gkctl_auto_join_and_reserve.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -euo pipefail + +gkctl instance list --current > /dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "[INFO] Current instance not found. Joining..." + gkctl instance join +else + echo "[INFO] Current instance already exists." +fi + +echo "[INFO] Reserving port..." +gkctl port reserve