end-to-end/upgrade/upgrade.sh

51 lines
1.1 KiB
Bash
Executable file

# SPDX-License-Identifier: MIT
UPGRADE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function upgrade_reset() {
local config=$1
reset_forgejo $UPGRADE_DIR/$config-app.ini
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() {
for config in default ; do
log_info "using $config app.ini"
upgrade_reset $config
for version in 1.18 1.19 1.20.2-0 1.20.3-0 1.20 1.21 $RELEASE_NUMBERS_AND_DEV ; do
log_info "run $version"
cleanup_storage
start $version
verify_storage
stop
done
done
}
source $UPGRADE_DIR/test-upgrade-forgejo-database-v3.sh
function test_upgrades() {
run dependencies
run build_all
run test_successful_upgrades
run test_forgejo_database_v3_upgrades
}