Palmr: formatting

This commit is contained in:
vhsdream 2025-08-04 10:12:24 -04:00
parent 8dbb30ba87
commit c427419bf9

View File

@ -20,52 +20,52 @@ color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/palmr_data ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/kyantech/palmr/releases/latest | yq '.tag_name' | sed 's/^v//')
if [[ "${RELEASE}" != "$(cat ~/.palmr 2>/dev/null)" ]] || [[ ! -f ~/.palmr ]]; then
msg_info "Stopping Services"
systemctl stop palmr-frontend palmr-backend
msg_ok "Stopped Services"
msg_info "Updating ${APP}"
cp /opt/palmr/apps/server/.env /opt/palmr.env
rm -rf /opt/palmr
fetch_and_deploy_gh_release "Palmr" "kyantech/Palmr" "tarball" "latest" "/opt/palmr"
PNPM="$(jq -r '.packageManager' /opt/palmr/package.json)"
NODE_VERSION="20" NODE_MODULE="$PNPM" setup_nodejs
cd /opt/palmr/apps/server
PALMR_DIR="/opt/palmr_data"
# export PALMR_DB="${PALMR_DIR}/palmr.db"
$STD pnpm install
mv /opt/palmr.env ./.env
$STD pnpm dlx prisma generate
$STD pnpm dlx prisma migrate deploy
$STD pnpm build
cd /opt/palmr/apps/web
export NODE_ENV=production
export NEXT_TELEMETRY_DISABLED=1
mv ./.env.example ./.env
$STD pnpm install
$STD pnpm build
msg_ok "Updated $APP"
msg_info "Starting Services"
systemctl start palmr-backend palmr-frontend
msg_ok "Started Services"
msg_ok "Updated Successfully"
else
msg_ok "Already up to date"
fi
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/palmr_data ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/kyantech/palmr/releases/latest | yq '.tag_name' | sed 's/^v//')
if [[ "${RELEASE}" != "$(cat ~/.palmr 2>/dev/null)" ]] || [[ ! -f ~/.palmr ]]; then
msg_info "Stopping Services"
systemctl stop palmr-frontend palmr-backend
msg_ok "Stopped Services"
msg_info "Updating ${APP}"
cp /opt/palmr/apps/server/.env /opt/palmr.env
rm -rf /opt/palmr
fetch_and_deploy_gh_release "Palmr" "kyantech/Palmr" "tarball" "latest" "/opt/palmr"
PNPM="$(jq -r '.packageManager' /opt/palmr/package.json)"
NODE_VERSION="20" NODE_MODULE="$PNPM" setup_nodejs
cd /opt/palmr/apps/server
PALMR_DIR="/opt/palmr_data"
# export PALMR_DB="${PALMR_DIR}/palmr.db"
$STD pnpm install
mv /opt/palmr.env ./.env
$STD pnpm dlx prisma generate
$STD pnpm dlx prisma migrate deploy
$STD pnpm build
cd /opt/palmr/apps/web
export NODE_ENV=production
export NEXT_TELEMETRY_DISABLED=1
mv ./.env.example ./.env
$STD pnpm install
$STD pnpm build
msg_ok "Updated $APP"
msg_info "Starting Services"
systemctl start palmr-backend palmr-frontend
msg_ok "Started Services"
msg_ok "Updated Successfully"
else
msg_ok "Already up to date"
fi
exit
}
start