Skip to content

Commit

Permalink
Merge pull request #567 from zebrunner/develop
Browse files Browse the repository at this point in the history
#566: organize v2.4 upgrade script
  • Loading branch information
vdelendik authored Aug 15, 2023
2 parents 59c8656 + f576338 commit 4da81d9
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
48 changes: 48 additions & 0 deletions patch/2.4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

# shellcheck disable=SC1091
source patch/utility.sh

TARGET_VERSION=2.4

source backup/settings.env
SOURCE_VERSION=${ZBR_VERSION}
#echo SOURCE_VERSION: $SOURCE_VERSION

if ! [[ "${TARGET_VERSION}" > "${SOURCE_VERSION}" ]]; then
#target Zebrunner version less or equal existing
echo "No need to perform upgrade to ${TARGET_VERSION}"
exit 2
fi

echo "Upgrading Zebrunner from ${SOURCE_VERSION} to ${TARGET_VERSION}"

# apply nginx changes

#apply mcloud changes
if [[ ! -f mcloud/.disabled ]] ; then
cp mcloud/.env mcloud/.env_2.3
cp mcloud/variables.env mcloud/variables.env_2.3

mcloud/zebrunner.sh setup
fi

#apply jenkins changes
if [[ ! -f jenkins/.disabled ]] ; then
cp jenkins/variables.env jenkins/variables.env_2.3
jenkins/zebrunner.sh setup
fi

# apply selenoid changes
if [[ ! -f selenoid/.disabled ]] ; then
cp selenoid/.env selenoid/.env_2.3
selenoid/zebrunner.sh setup
fi

echo "Upgrade to ${TARGET_VERSION} finished successfully"

#remember successfully applied version in settings.env file
export ZBR_VERSION=${TARGET_VERSION}

#save information about upgraded zebrunner version
export_settings
10 changes: 8 additions & 2 deletions zebrunner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
fi

export ZBR_INSTALLER=1
export ZBR_VERSION=2.3
export ZBR_VERSION=2.4
set_global_settings

cp .env.original .env
Expand Down Expand Up @@ -516,9 +516,15 @@
exit -1
fi

patch/2.4.sh
p2_4=$?
if [[ ${p2_4} -eq 1 ]]; then
echo "ERROR! 2.4 patchset was not applied correctly!"
exit -1
fi

# IMPORTANT! Increment latest verification to new version, i.e. p1_3, p1_4 etc to verify latest upgrade status
if [[ ${p2_3} -eq 2 ]]; then
if [[ ${p2_4} -eq 2 ]]; then
echo "No need to restart service as nothing was upgraded."
exit -1
fi
Expand Down

0 comments on commit 4da81d9

Please sign in to comment.