sync build tree from private myoffice

This commit is contained in:
myoffice-sync
2026-08-05 13:37:48 +00:00
parent e9534034ee
commit 76c3da36cd
3 changed files with 62 additions and 13 deletions
+28
View File
@@ -449,6 +449,32 @@ push_install_assets() {
pct exec "$CTID" -- chmod +x "${dest_dir}/install-in-ct.sh" "${dest_dir}/fetch-release.sh" "${dest_dir}/update.sh"
}
# CT often cannot reach Gitea (isolated LAN). Download release on the Proxmox host, then push in.
download_release_on_host() {
local host_tar="/tmp/myoffice-publish.tar.gz"
local fetch_src
msg_info "Downloading release on Proxmox host..."
if [[ -n "${SCRIPT_DIR}" && -f "${SCRIPT_DIR}/fetch-release.sh" ]]; then
fetch_src="${SCRIPT_DIR}/fetch-release.sh"
else
curl -fsSL "${REPO_RAW_BASE}/proxmox/fetch-release.sh" -o /tmp/fetch-release.sh
fetch_src=/tmp/fetch-release.sh
fi
# shellcheck disable=SC1090
GITEA_URL="$GITEA_URL" \
GITEA_OWNER="$GITEA_OWNER" \
GITEA_REPO="$GITEA_REPO" \
RELEASE_TAG="$RELEASE_TAG" \
RELEASE_ASSET_URL="$RELEASE_ASSET_URL" \
GITEA_TOKEN="$GITEA_TOKEN" \
bash -c 'source "'"$fetch_src"'" && download_asset_to "'"$host_tar"'"'
pct push "$CTID" "$host_tar" "/tmp/myoffice-publish.tar.gz"
msg_ok "Release pushed into CT"
}
run_ct_install() {
if [[ -z "${PUBLIC_URL}" ]]; then
PUBLIC_URL="http://${CT_IP}:${API_PORT}"
@@ -457,6 +483,7 @@ run_ct_install() {
msg_error "Set GITEA_URL + GITEA_OWNER (and GITEA_REPO), or RELEASE_ASSET_URL, before install."
exit 1
fi
download_release_on_host
msg_info "Installing PostgreSQL + ASP.NET runtime + Gitea release..."
pct exec "$CTID" -- env \
REPO_RAW_BASE="$REPO_RAW_BASE" \
@@ -470,6 +497,7 @@ run_ct_install() {
RELEASE_TAG="$RELEASE_TAG" \
RELEASE_ASSET_URL="$RELEASE_ASSET_URL" \
GITEA_TOKEN="$GITEA_TOKEN" \
LOCAL_RELEASE_TAR="/tmp/myoffice-publish.tar.gz" \
bash /tmp/myoffice-proxmox/install-in-ct.sh
msg_ok "Stack installed"
}