scripts/tests/rollingupgrade: test current release version on master
branch Currently, we are testing previous release version upgrading to latest master on each master build However, this behavior is only desired when the test is running on a release branch. Change-Id: Iaeb66f44951c9e4934ca3c8316d1e490d7958239
This commit is contained in:
parent
d6b9563e56
commit
746cbfc659
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -67,7 +67,7 @@ node('node') {
|
||||
sh 'docker exec postgres-$BUILD_NUMBER createdb -U postgres teststorj'
|
||||
// fetch the remote master branch
|
||||
sh 'git fetch --no-tags --progress -- https://github.com/storj/storj.git +refs/heads/master:refs/remotes/origin/master'
|
||||
sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS --link redis-$BUILD_NUMBER:redis --link postgres-$BUILD_NUMBER:postgres -e CC=gcc storjlabs/golang:1.15.2'
|
||||
sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh -e BRANCH_NAME -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS --link redis-$BUILD_NUMBER:redis --link postgres-$BUILD_NUMBER:postgres -e CC=gcc storjlabs/golang:1.15.2'
|
||||
}
|
||||
catch(err){
|
||||
throw err
|
||||
|
@ -47,16 +47,23 @@ populate_sno_versions(){
|
||||
# set peers' 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
|
||||
BRANCH_NAME=${BRANCH_NAME:-""}
|
||||
git fetch --tags
|
||||
# if it's running on a release branch, we will set the stage 1 version to be the latest previous major release
|
||||
# if it's running on master, we will set the stage 1 version to be the current release version
|
||||
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)
|
||||
stage1_release_version=$(git tag -l --sort -version:refname | grep -v rc | head -1)
|
||||
if [[ $BRANCH_NAME = v* ]]; then
|
||||
current_major_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_major_release_version* --tags --max-count=1`)
|
||||
stage1_release_version=$previous_release_version
|
||||
fi
|
||||
stage1_sat_version=$stage1_release_version
|
||||
stage1_uplink_version=$stage1_release_version
|
||||
stage1_storagenode_versions=$(populate_sno_versions $stage1_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)
|
||||
stage2_uplink_versions=$stage1_release_version\ $current_commit
|
||||
stage2_storagenode_versions=$(populate_sno_versions $stage1_release_version 5)\ $(populate_sno_versions $current_commit 5)
|
||||
|
||||
echo "stage1_sat_version" $stage1_sat_version
|
||||
echo "stage1_uplink_version" $stage1_uplink_version
|
||||
@ -201,7 +208,6 @@ for version in ${unique_versions}; do
|
||||
|
||||
echo -e "\nAdding worktree for ${version} in ${dir}."
|
||||
git worktree add -f "$dir" "${version}"
|
||||
rm -f ${dir}/private/version/release.go
|
||||
rm -f ${dir}/internal/version/release.go
|
||||
# clear out release information
|
||||
cat > ${dir}/private/version/release.go <<-EOF
|
||||
@ -210,7 +216,7 @@ for version in ${unique_versions}; do
|
||||
package version
|
||||
EOF
|
||||
|
||||
if [[ $version = $previous_release_version || $version = $current_commit ]]
|
||||
if [[ $version = $stage1_release_version || $version = $current_commit ]]
|
||||
then
|
||||
echo "Installing storj-sim for ${version} in ${dir}."
|
||||
pushd ${dir}
|
||||
|
Loading…
Reference in New Issue
Block a user