Skip to content

Commit f469607

Browse files
committed
fix: simplify Bifrost releases and report failed updates accurately
1 parent e3c0833 commit f469607

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

‎ct/bifrost.sh‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ function update_script() {
5050

5151
BACKUP_DIR="/opt/bifrost-backup-$(date +%Y%m%d-%H%M%S)" create_backup /opt/bifrost_data /opt/bifrost/bifrost-http ~/.bifrost
5252

53-
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "bifrost" "maximhq/bifrost" "tarball" "$CHECK_UPDATE_RELEASE"
54-
5553
msg_info "Installing Bifrost Gateway"
5654
install -m 755 /opt/bifrost-update/bifrost-http /opt/bifrost/bifrost-http
5755
cd /opt/bifrost || exit 1
@@ -62,8 +60,16 @@ function update_script() {
6260
systemctl start bifrost
6361
$STD curl --fail --silent --show-error --retry 30 --retry-connrefused --retry-delay 2 --retry-max-time 120 --max-time 5 http://127.0.0.1:8080/health
6462
systemctl is-active --quiet bifrost
63+
cat <<EOF >~/.bifrost
64+
${CHECK_UPDATE_RELEASE}
65+
EOF
6566
msg_ok "Started Bifrost"
6667
msg_ok "Updated Bifrost successfully!"
68+
else
69+
RELEASE_CHECK_STATUS=$?
70+
if [[ "$RELEASE_CHECK_STATUS" -ne 1 ]]; then
71+
exit "$RELEASE_CHECK_STATUS"
72+
fi
6773
fi
6874
exit
6975
}

‎install/bifrost-install.sh‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ setting_up_container
1313
network_check
1414
update_os
1515

16-
# The monorepo also releases SDKs and plugins; select only stable gateway releases.
17-
fetch_and_deploy_gh_release "bifrost" "maximhq/bifrost" "tarball" "latest" "/opt/bifrost" "" "transports/v"
16+
# Gateway binaries live on the upstream CDN; GitHub also releases unrelated SDKs and plugins.
17+
if ! check_for_gh_release "bifrost" "maximhq/bifrost" "${var_appversion:-}" "" "transports/v"; then
18+
msg_error "Could not select a Bifrost gateway release"
19+
exit 1
20+
fi
1821

1922
msg_info "Installing Bifrost Gateway"
20-
BIFROST_VERSION=$(cat ~/.bifrost)
21-
BIFROST_URL="https://downloads.getmaxim.ai/bifrost/${BIFROST_VERSION##*/}/linux/$(arch_resolve)"
22-
mkdir -p /opt/bifrost-update
23+
BIFROST_URL="https://downloads.getmaxim.ai/bifrost/${CHECK_UPDATE_RELEASE##*/}/linux/$(arch_resolve)"
24+
mkdir -p /opt/bifrost /opt/bifrost-update
2325
chmod 700 /opt/bifrost-update
2426
curl_with_retry "${BIFROST_URL}/bifrost-http" /opt/bifrost-update/bifrost-http
2527
curl_with_retry "${BIFROST_URL}/bifrost-http.sha256" /opt/bifrost-update/bifrost-http.sha256
@@ -81,6 +83,9 @@ EOF
8183
systemctl enable -q --now bifrost
8284
$STD curl --fail --silent --show-error --retry 30 --retry-connrefused --retry-delay 2 --retry-max-time 120 --max-time 5 http://127.0.0.1:8080/health
8385
systemctl is-active --quiet bifrost
86+
cat <<EOF >~/.bifrost
87+
${CHECK_UPDATE_RELEASE}
88+
EOF
8489
msg_ok "Created Bifrost Service"
8590

8691
motd_ssh

0 commit comments

Comments
 (0)