release/rollingupgrade: on release tags run rolling upgrade against previous release (#3792)

Co-authored-by: Stefan Benten <mail@stefan-benten.de>
This commit is contained in:
littleskunk 2020-03-03 23:56:32 +01:00 committed by GitHub
parent 7244a6a84e
commit 8fa8178f04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,10 +4,11 @@
# Description of test:
# Stage 1:
# * Set up a storj-sim network on the latest point release (all storagenodes and satellite on latest point release).
# * If the current commit is a release tag use the previous release instead. Exclude -rc release tags.
# * Check out the latest point release of the uplink.
# * (test-versions.sh upload) - Upload an inline, remote, and multisegment file to the network with the selected uplink.
# Stage 2:
# * Upgrade the satellite to master. Run an "old" satellite api server on the latest point release (port 30000).
# * Upgrade the satellite to current commit. Run an "old" satellite api server on the latest point release (port 30000).
# * Keep half of the storagenodes on the latest point release. Upgrade the other half to master.
# * Point half of the storagenodes to the old satellite api (port 30000). Keep the other half on the new satellite api (port 10000).
# * Check out the master version of the uplink.
@ -47,13 +48,15 @@ populate_sno_versions(){
# in stage 1: satellite, uplink, and storagenode use latest release version
# in stage 2: satellite core uses latest release version and satellite api uses master. Storage nodes are split into half on latest release version and half on master. Uplink uses the latest release version plus master
git fetch --tags
current_release_version=$(git tag -l --sort -version:refname | grep -v "rc" | sort -n -k2,2 -t'.' --unique | tail -n 1)
stage1_sat_version=$current_release_version
stage1_uplink_version=$current_release_version
stage1_storagenode_versions=$(populate_sno_versions $current_release_version 10)
stage2_sat_version="master"
stage2_uplink_versions=$current_release_version\ "master"
stage2_storagenode_versions=$(populate_sno_versions $current_release_version 5)\ $(populate_sno_versions "master" 5)
current_commit=$(git rev-parse HEAD)
current_release_version=$(git describe --tags $current_commit | cut -d '.' -f 1-2)
previous_release_version=$(git describe --tags `git rev-list --exclude='*rc*' --exclude=$current_release_version --tags --max-count=1`)
stage1_sat_version=$previous_release_version
stage1_uplink_version=$previous_release_version
stage1_storagenode_versions=$(populate_sno_versions $previous_release_version 10)
stage2_sat_version=$current_commit
stage2_uplink_versions=$previous_release_version\ $current_commit
stage2_storagenode_versions=$(populate_sno_versions $previous_release_version 5)\ $(populate_sno_versions $current_commit 5)
echo "stage1_sat_version" $stage1_sat_version
echo "stage1_uplink_version" $stage1_uplink_version
@ -196,7 +199,7 @@ for version in ${unique_versions}; do
fi
rm -f ${dir}/private/version/release.go
rm -f ${dir}/internal/version/release.go
if [[ $version = $current_release_version || $version = "master" ]]
if [[ $version = $previous_release_version || $version = "master" ]]
then
echo "Installing storj-sim for ${version} in ${dir}."
pushd ${dir}
@ -273,9 +276,9 @@ for ul_version in ${stage2_uplink_versions}; do
ln -f ${src_ul_version_dir}/bin/uplink $test_dir/bin/uplink
PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/test-rolling-upgrade.sh" "${test_dir}/local-network" "${stage1_uplink_version}"
if [[ $ul_version == "master" ]]
if [[ $ul_version == $current_commit ]]
then
echo "Running final upload/download test on master"
echo "Running final upload/download test on $current_commit"
PATH=$test_dir/bin:$PATH storj-sim -x --host "${STORJ_NETWORK_HOST4}" --config-dir "${test_dir}/local-network" network test bash "${scriptdir}/test-rolling-upgrade-final-upload.sh" "${test_dir}/local-network"
fi
done