#!/usr/bin/env bash set -euo pipefail repo_root="${REPO_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../.." && pwd)}" # shellcheck source=scripts/apk/test-install-lib.sh . "${repo_root}/scripts/apk/test-install-lib.sh" apk_test_install_run "${repo_root}" "${PACKAGE_NAME:-gitea}" "${PACKAGE_VERSION:-1.27.0-r1}" <<'SCRIPT' set -e if [ -n "${ALPINE_REPOSITORY_URL}" ]; then if [ -n "${ALPINE_REPOSITORY_KEY_URL}" ]; then apk add --no-cache curl >/dev/null cd /etc/apk/keys curl -fsSLOJ "${ALPINE_REPOSITORY_KEY_URL}" fi printf "%s\n" "${ALPINE_REPOSITORY_URL}" >> /etc/apk/repositories else apk update apk add "${PACKAGE_NAME}" installed_before="$(apk list -I "${PACKAGE_NAME}" | awk "{print \$1}")" printf "Installed repository package before local upgrade: %s\n" "${installed_before}" if [ "${installed_before}" = "${PACKAGE_NAME}-${PACKAGE_VERSION}" ]; then printf "default repository already has %s; upgrade path was not exercised\n" "${PACKAGE_VERSION}" >&2 exit 1 fi cp "/repo/${ALPINE_ARCH}"/*.rsa.pub /etc/apk/keys/ printf "%s\n" /repo >> /etc/apk/repositories fi apk update apk add --upgrade "${PACKAGE_NAME}" "${PACKAGE_NAME}-doc" "${PACKAGE_NAME}-openrc" installed_after="$(apk list -I "${PACKAGE_NAME}" | awk "{print \$1}")" printf "Installed package after local upgrade: %s\n" "${installed_after}" test "${installed_after}" = "${PACKAGE_NAME}-${PACKAGE_VERSION}" test -x /usr/bin/gitea test -f /etc/gitea/app.ini test -d /var/lib/gitea test -d /var/lib/gitea/git test -d /var/lib/gitea/data test -d /var/lib/gitea/db test -d /var/log/gitea test -d /usr/share/webapps/gitea/options test -d /usr/share/webapps/gitea/public test -d /usr/share/webapps/gitea/templates test -f /etc/init.d/gitea gitea --version rc-update add gitea default test -L /etc/runlevels/default/gitea SCRIPT