Skip to content

Commit

Permalink
Merge pull request #523 from zebrunner/develop
Browse files Browse the repository at this point in the history
2.1 rc
  • Loading branch information
vdelendik authored Jul 29, 2022
2 parents acd9eb3 + 58ff31e commit fc52907
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 7 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
- ./nginx/ssl:/etc/nginx/ssl:ro
- ./nginx/grid:/usr/share/nginx/html/grid
- ./selenoid/video:/usr/share/nginx/video:ro
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
logging:
options:
max-size: "512m"
Expand Down
2 changes: 1 addition & 1 deletion jenkins
2 changes: 1 addition & 1 deletion patch/2.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TARGET_VERSION=2.0

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

if ! [[ "${TARGET_VERSION}" > "${SOURCE_VERSION}" ]]; then
#target Zebrunner version less or equal existing
Expand Down
47 changes: 47 additions & 0 deletions patch/2.1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# shellcheck disable=SC1091
source patch/utility.sh

TARGET_VERSION=2.1

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 mcloud changes
if [[ ! -f mcloud/.disabled ]] ; then
cp mcloud/.env mcloud/.env_2.0
cp mcloud/variables.env mcloud/variables.env_2.0

mcloud/zebrunner.sh setup
fi

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

# apply selenoid changes
if [[ ! -f selenoid/.disabled ]] ; then
cp selenoid/.env selenoid/.env_2.0
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
2 changes: 1 addition & 1 deletion selenoid
Submodule selenoid updated 3 files
+1 −1 .env.original
+1 −0 .gitignore
+18 −1 zebrunner.sh
26 changes: 23 additions & 3 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.0
export ZBR_VERSION=2.1
set_global_settings

cp .env.original .env
Expand All @@ -49,6 +49,10 @@

# Reporting is obligatory component now. But to be able to disable it we can register REPORTING_DISABLED=1 env variable before setup
if [[ $ZBR_REPORTING_ENABLED -eq 1 && -z $REPORTING_DISABLED ]]; then
# 411 There is ".disabled" present in minio-storage after setup all components
rm -f reporting/.disabled
rm -f reporting/minio-storage/.disabled

set_reporting_settings
reporting/zebrunner.sh setup
else
Expand Down Expand Up @@ -370,7 +374,15 @@
exit -1
fi

confirm "" " Your services will be stopped and current data might be lost. Do you want to do a restore now?" "n"
if [ ! -f backup/settings.env.bak ]; then
echo_warning "You have to backup something in advance using: ./zebrunner.sh backup"
echo_telegram
exit -1

fi

echo " Your services will be stopped and current data might be lost."
confirm "" " Do you want to do a restore to \"`date -r backup/settings.env.bak`\" state?" "n"
if [[ $? -eq 0 ]]; then
exit
fi
Expand Down Expand Up @@ -488,8 +500,16 @@
exit -1
fi

patch/2.1.sh
p2_1=$?
if [[ ${p2_1} -eq 1 ]]; then
echo "ERROR! 2.1 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_0} -eq 2 ]]; then
if [[ ${p2_1} -eq 2 ]]; then
echo "No need to restart service as nothing was upgraded."
exit -1
fi
Expand Down

0 comments on commit fc52907

Please sign in to comment.