end-to-end/upgrade/upgrade.sh

105 lines
2.2 KiB
Bash
Raw Normal View History

# SPDX-License-Identifier: MIT
UPGRADE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function upgrade_reset() {
local config=$1
reset_forgejo $config
reset_minio
}
function verify_storage() {
local work_path=$DIR/forgejo-work-path
for path in ${STORAGE_PATHS} ; do
test -d $work_path/data/$path
done
}
function cleanup_storage() {
local work_path=$DIR/forgejo-work-path
for path in ${STORAGE_PATHS} ; do
rm -fr $work_path/data/$path
done
}
function test_successful_upgrades() {
2024-03-17 17:22:44 +01:00
stop
for config in $UPGRADE_DIR/default-app.ini ; do
log_info "using $config"
upgrade_reset $config
2024-04-25 12:39:48 +02:00
version=1.21
2024-03-17 17:22:44 +01:00
log_info "run $version"
cleanup_storage
start $version
fixture_create
fixture_assert
doctor_run $config
2024-03-17 17:22:44 +01:00
2024-04-25 12:39:48 +02:00
for version in $RELEASE_NUMBERS_AND_DEV ; do
2024-03-17 17:22:44 +01:00
stop
log_info "run $version"
start $version
verify_storage
2024-03-17 17:22:44 +01:00
fixture_assert
doctor_run $config
done
done
}
function download_gitea() {
local version=$1
if ! test -f $DIR_BINARIES/gitea-$version ; then
mkdir -p $DIR_BINARIES
wget -O $DIR_BINARIES/gitea-$version --quiet https://dl.gitea.com/gitea/$version/gitea-$version-linux-amd64
chmod +x $DIR_BINARIES/gitea-$version
fi
}
function start_gitea() {
local version=$1
download_gitea $version
start_forgejo_daemon $version $DIR_BINARIES/gitea-$version
}
function test_gitea_upgrades() {
stop
for config in $UPGRADE_DIR/default-app.ini ; do
log_info "using $config"
upgrade_reset $config
version=1.21.10
log_info "run gitea $version"
cleanup_storage
start_s3 minio
start_gitea $version
fixture_create
fixture_assert
doctor_run $config
for version in 7.0-test ; do
stop
log_info "run forgejo $version"
start $version
verify_storage
fixture_assert
doctor_run $config
done
done
}
2024-04-01 01:47:56 +02:00
source $UPGRADE_DIR/test-pprof-upload.sh
function test_upgrades() {
run dependencies
run build_all
run test_successful_upgrades
2024-04-01 01:47:56 +02:00
run test_forgejo_pprof
run test_gitea_upgrades
}