1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-05-02 18:23:07 +00:00

Add build time var (#4167)

This commit is contained in:
Gerhard Burger 2025-05-01 19:17:16 +02:00 committed by GitHub
parent abfe9114c7
commit 9905012cd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View File

@ -35,6 +35,15 @@ function update_script() {
echo "Installed NPM..."
fi
fi
# ensure that jq is installed
if ! command -v jq &>/dev/null; then
$STD msg_info "Installing jq..."
$STD apt-get update -qq &>/dev/null
$STD apt-get install -y jq &>/dev/null || {
msg_error "Failed to install jq"
exit
}
fi
LOCAL_IP=$(hostname -I | awk '{print $1}')
RELEASE=$(curl -fsSL https://api.github.com/repos/gethomepage/homepage/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
@ -50,6 +59,7 @@ function update_script() {
$STD npx --yes update-browserslist-db@latest
export NEXT_PUBLIC_VERSION="v$RELEASE"
export NEXT_PUBLIC_REVISION="source"
export NEXT_PUBLIC_BUILDTIME=$(curl -fsSL https://api.github.com/repos/gethomepage/homepage/releases/latest | jq -r '.published_at')
export NEXT_TELEMETRY_DISABLED=1
$STD pnpm build
if [[ ! -f /opt/homepage/.env ]]; then

View File

@ -14,7 +14,7 @@ network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y gpg
$STD apt-get install -y gpg jq
msg_ok "Installed Dependencies"
msg_info "Setting up Node.js Repository"
@ -43,6 +43,7 @@ cp /opt/homepage/src/skeleton/* /opt/homepage/config
$STD pnpm install
export NEXT_PUBLIC_VERSION="v$RELEASE"
export NEXT_PUBLIC_REVISION="source"
export NEXT_PUBLIC_BUILDTIME=$(curl -fsSL https://api.github.com/repos/gethomepage/homepage/releases/latest | jq -r '.published_at')
export NEXT_TELEMETRY_DISABLED=1
$STD pnpm build
echo "HOMEPAGE_ALLOWED_HOSTS=localhost:3000,${LOCAL_IP}:3000" >/opt/homepage/.env