release: sync public installer asset install.sh
This commit is contained in:
+16
@@ -1330,6 +1330,22 @@ progress '下载 bootstrap runtime'
|
|||||||
if ! run_logged "${COMPOSE[@]}" --project-directory "$INSTALL_DIR" --env-file "$INSTALL_DIR/.env" -f "$INSTALL_DIR/compose.yaml" "${COMPOSE_FUSE[@]}" pull app; then
|
if ! run_logged "${COMPOSE[@]}" --project-directory "$INSTALL_DIR" --env-file "$INSTALL_DIR/.env" -f "$INSTALL_DIR/compose.yaml" "${COMPOSE_FUSE[@]}" pull app; then
|
||||||
die 'bootstrap runtime 下载失败;请确认能访问 git.keeper.work Container Registry'
|
die 'bootstrap runtime 下载失败;请确认能访问 git.keeper.work Container Registry'
|
||||||
fi
|
fi
|
||||||
|
validate_bootstrap_runtime_platform() {
|
||||||
|
local bootstrap_image_id runtime_metadata runtime_os runtime_arch runtime_platform
|
||||||
|
bootstrap_image_id=$("${COMPOSE[@]}" --project-directory "$INSTALL_DIR" --env-file "$INSTALL_DIR/.env" -f "$INSTALL_DIR/compose.yaml" images -q app 2>>"$INSTALL_LOG" | tr -d '[:space:]') || die '无法确定 bootstrap runtime 的本地镜像 ID'
|
||||||
|
[[ -n $bootstrap_image_id ]] || die '无法确定 bootstrap runtime 的本地镜像 ID'
|
||||||
|
runtime_metadata=$(docker image inspect --format '{{.Os}}\t{{.Architecture}}' "$bootstrap_image_id" 2>>"$INSTALL_LOG") || die '无法读取 bootstrap runtime 的本地镜像平台元数据'
|
||||||
|
IFS=$'\t' read -r runtime_os runtime_arch <<<"$runtime_metadata"
|
||||||
|
[[ -n $runtime_os && -n $runtime_arch ]] || die 'bootstrap runtime 的本地镜像平台元数据不完整'
|
||||||
|
runtime_platform="$runtime_os/$runtime_arch"
|
||||||
|
case "$runtime_platform" in
|
||||||
|
linux/amd64) runtime_platform=linux-amd64;;
|
||||||
|
linux/arm64) runtime_platform=linux-arm64;;
|
||||||
|
*) die "bootstrap runtime 平台为 $runtime_platform,无法验证;需要 linux-amd64 或 linux-arm64 的 multiarch 镜像";;
|
||||||
|
esac
|
||||||
|
[[ $runtime_platform == "$PLATFORM" ]] || die "bootstrap runtime 平台为 $runtime_platform,但当前主机需要 $PLATFORM;请使用 multiarch 镜像"
|
||||||
|
}
|
||||||
|
validate_bootstrap_runtime_platform
|
||||||
progress '准备 PostgreSQL 连接'
|
progress '准备 PostgreSQL 连接'
|
||||||
if (( LOCAL_DB )); then
|
if (( LOCAL_DB )); then
|
||||||
if ! run_logged "${COMPOSE[@]}" --profile local-db --project-directory "$INSTALL_DIR" --env-file "$INSTALL_DIR/.env" -f "$INSTALL_DIR/compose.yaml" up -d postgres; then
|
if ! run_logged "${COMPOSE[@]}" --profile local-db --project-directory "$INSTALL_DIR" --env-file "$INSTALL_DIR/.env" -f "$INSTALL_DIR/compose.yaml" up -d postgres; then
|
||||||
|
|||||||
Reference in New Issue
Block a user