Обновить scripts/deploy-nextcloud.sh
Nextcloud CI/CD / Deploy Nextcloud (push) Failing after 2s

This commit is contained in:
2026-09-30 12:53:21 +03:00
parent 83b86157d0
commit bdacca1931
+47 -9
View File
@@ -296,32 +296,70 @@ OLD_IMAGE="$(
# ============================================================
# Detect actual current Nextcloud version
# Detect current Nextcloud status/version
#
# Use OCC instead of reading version.php directly.
# OCC is the supported machine-readable interface and also
# verifies that the currently running installation can load.
# ============================================================
log "Detect current Nextcloud version"
CURRENT_NC_VERSION="$(
set +e
CURRENT_STATUS_JSON="$(
docker exec \
-u www-data \
nextcloud \
php -r '
require "/var/www/html/version.php";
echo implode(".", $OC_Version);
'
php occ status \
--output=json \
2>&1
)"
CURRENT_STATUS_RC=$?
set -e
if [[ "${CURRENT_STATUS_RC}" -ne 0 ]]
then
echo
echo "--- OCC status output ---"
echo "${CURRENT_STATUS_JSON}"
fail \
"Could not get current Nextcloud status (exit code ${CURRENT_STATUS_RC})"
fi
CURRENT_NC_VERSION="$(
printf '%s\n' "${CURRENT_STATUS_JSON}" |
sed -nE \
's/.*"versionstring"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/p' |
head -n1
)"
[[ -n "${CURRENT_NC_VERSION}" ]] || \
[[ -n "${CURRENT_NC_VERSION}" ]] || {
echo
echo "OCC output:"
echo "${CURRENT_STATUS_JSON}"
fail "Could not determine current Nextcloud version"
}
echo "Current Docker image:"
echo "Current image:"
echo " ${OLD_IMAGE}"
echo "Current Nextcloud version:"
echo " ${CURRENT_NC_VERSION}"
# ============================================================
# Pull target Nextcloud image
#