Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/allsky_camera.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified html/documentation/settings/AllskySettingsPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scripts/installUpgradeFunctions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export OLD_WEBSITE_LOCATION="${OLD_WEBUI_LOCATION}/allsky"

# Directory of prior version of Allsky, if it exists.
export PRIOR_ALLSKY_DIR="$( dirname "${ALLSKY_HOME}" )/${ALLSKY_INSTALL_DIR}-OLD"
export OLDEST_ALLSKY_DIR="${PRIOR_ALLSKY_DIR/-OLD$/-OLDEST}"
# Prior "config" directory, if it exists.
export PRIOR_CONFIG_DIR="${PRIOR_ALLSKY_DIR}/$( basename "${ALLSKY_CONFIG}" )"
export PRIOR_WEBSITE_DIR="${PRIOR_ALLSKY_DIR}${ALLSKY_WEBSITE/${ALLSKY_HOME}/}"
Expand Down
46 changes: 34 additions & 12 deletions scripts/utilities/getNewestAllskyVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,61 @@ source "${ALLSKY_HOME}/variables.sh" || exit "${EXIT_ERROR_STOP}"
#shellcheck source-path=scripts
source "${ALLSKY_SCRIPTS}/installUpgradeFunctions.sh" || exit "${EXIT_ERROR_STOP}"

if [[ ${1} == "--branch" ]]; then
BRANCH="${2}"
shift 2
else
BRANCH="${GITHUB_MAIN_BRANCH}"
fi
BRANCH=""
VERSION_ONLY="false"
while [[ $# -gt 0 ]]; do
ARG="${1}"
case "${ARG,,}" in
--branch)
BRANCH="${2}"
shift
;;
--version-only)
VERSION_ONLY="true"
;;
esac
shift
done

[[ -z ${BRANCH} ]] && BRANCH="${GITHUB_MAIN_BRANCH}"

GIT_FILE="${GITHUB_RAW_ROOT}/${GITHUB_ALLSKY_REPO}/${BRANCH}/version"
if ! NEWEST_VERSION="$( curl --show-error --silent "${GIT_FILE}" 2>&1 )" ; then
echo "${ME}: ERROR: Unable to get newest Allsky version: ${NEWEST_VERSION}."
if ! NEWEST_INFO="$( curl --show-error --silent "${GIT_FILE}" 2>&1 )" ; then
echo "${ME}: ERROR: Unable to get newest Allsky version: ${NEWEST_INFO}." >&2
exit 1
fi
if [[ -z ${NEWEST_INFO} ]]; then
echo "${ME}: ERROR: Empty newest Allsky version for branch '${BRANCH}'." >&2
exit 1
fi
NEWEST_VERSION="$( echo "${NEWEST_INFO}" | head -1 )"
if [[ ${NEWEST_VERSION:0:1} != "v" ||
${NEWEST_VERSION} == "400: Invalid request" ||
${NEWEST_VERSION} == "404: Not Found" ]]; then
echo "${ME}: ERROR: Got unknown newest Allsky version: ${NEWEST_VERSION}."
echo "${ME}: ERROR: Got unknown newest Allsky version: ${NEWEST_VERSION}." >&2
exit 1
fi

if [[ ${VERSION_ONLY} == "true" ]]; then
# Just output the newest version and quit.
echo "${NEWEST_VERSION}"
exit 0
fi

#shellcheck disable=SC2119
CURRENT_VERSION="$( get_version )"
NOTE=""
RET=0
if [[ ${CURRENT_VERSION} == "${NEWEST_VERSION}" ]]; then
RET=0
elif [[ ${CURRENT_VERSION} < "${NEWEST_VERSION}" ]]; then
NOTE="$( get_version --note )"
RET="${EXIT_PARTIAL_OK}"
else
# Current newer than newest - this can happen if testing a newer release.
RET=0
fi

echo "${NEWEST_VERSION}"
[[ -n ${NOTE} ]] && echo "${NOTE}"
NEWEST_NOTE="$( echo "${NEWEST_INFO}" | tail -1 )"
[[ -n ${NEWEST_NOTE} ]] && echo "${NEWEST_NOTE}"

exit "${RET}"
Loading