Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.6 rc #433

Merged
merged 30 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
bd61d78
switch to latest mcloud
Feb 24, 2021
515ae97
switched to the latest reporting
Feb 24, 2021
2f5507a
Merge branch 'develop' of github.com:zebrunner/zebrunner into develop
Feb 24, 2021
4d0f9da
switched to the latest reporting
Feb 27, 2021
8f9f2b7
removed information about jenkinsQueueRegistration testng suite argument
Mar 2, 2021
b6d28f7
switched to the selenoif from develop
Mar 2, 2021
8427db6
switched to the latest selenoid
Mar 2, 2021
cb4b862
switched to the latest jenkins
Mar 2, 2021
8e97ed8
swicthed to the latest sonarqube
Mar 5, 2021
b201ef8
switched to the latest reporting
Mar 5, 2021
82eb645
switched to the latest reporting ima service
Mar 5, 2021
a9da06c
switched to the latest reporting
Mar 5, 2021
b900b4b
switched to the latest sonarqube
Mar 9, 2021
c0c85b4
switched to the latest jenkins slave
Mar 9, 2021
106c9f0
switched to the released jenkins-slave
Mar 9, 2021
6a962a3
switched to the latest jenkins
Mar 9, 2021
e7786fa
swicthed to the latest reporting
Mar 9, 2021
ec20b9c
#424: implement upgrade steps to 1.6 including selenoid changes
Mar 9, 2021
5fa0a47
switched to the latest sonarqube
Mar 9, 2021
d566fbc
switched to the latest sonarqube
Mar 10, 2021
2e2f925
Merge branch 'develop' of https://github.com/zebrunner/zebrunner into…
Mar 10, 2021
9e5ce1e
restored v1.2 sonarqube
Mar 11, 2021
8512afc
Merge branch 'develop' of https://github.com/zebrunner/zebrunner into…
Mar 11, 2021
2b67afa
switched to the released mcloud v1.2
Mar 11, 2021
3c2f184
switched to the released v1.22 reporting
Mar 11, 2021
3739725
restored jenkins-master 1.4
Mar 11, 2021
ce3276b
removed jenkins upgrade steps
Mar 11, 2021
9bcdb9e
bump up to 1.22.1 reporting service
Mar 11, 2021
c128ad0
adjusted widget template according to task removal operation
Mar 14, 2021
e7dd584
switched to the patched reporting
Mar 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ZBR_VERSION=1.5
ZBR_VERSION=1.6
TAG_NGINX=1.17
2 changes: 0 additions & 2 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ When it is "abort" we halt the entire pipeline as only failed job detected. It m
</br>
<b>jenkinsFailedSlackChannels</b> - This property takes a comma separated list of slack channels to notify about failures.
</br>
<b>jenkinsQueueRegistration</b> - This property is a boolean parameter to manage queue registration. Disabling is recommended for suites with dynamic number of tests or dynamic test names.
</br>
<b>jenkinsDefaultRetryCount</b> - This property allows to provide custom retry_count property (number of extra attempts for test execution).
</br>
<b>jenkinsNodeLabel</b> - This property allows to override slave label and execute test on custom server.
Expand Down
2 changes: 1 addition & 1 deletion mcloud
116 changes: 116 additions & 0 deletions patch/1.6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/bin/bash

export_settings() {
export -p | grep "ZBR" > backup/settings.env
}

confirm() {
local message=$1
local question=$2
local isEnabled=$3

if [[ "$isEnabled" == "1" ]]; then
isEnabled="y"
fi
if [[ "$isEnabled" == "0" ]]; then
isEnabled="n"
fi

while true; do
if [[ ! -z $message ]]; then
echo "$message"
fi

read -p "$question y/n [$isEnabled]:" response
if [[ -z $response ]]; then
if [[ "$isEnabled" == "y" ]]; then
return 1
fi
if [[ "$isEnabled" == "n" ]]; then
return 0
fi
fi

if [[ "$response" == "y" || "$response" == "Y" ]]; then
return 1
fi

if [[ "$response" == "n" || "$response" == "N" ]]; then
return 0
fi

echo "Please answer y (yes) or n (no)."
echo
done
}

replace() {
#TODO: https://github.com/zebrunner/zebrunner/issues/328 organize debug logging for setup/replace
file=$1
#echo "file: $file"
content=$(<$file) # read the file's content into
#echo "content: $content"

old=$2
#echo "old: $old"

new=$3
#echo "new: $new"
content=${content//"$old"/$new}

#echo "content: $content"

printf '%s' "$content" >$file # write new content to disk
}

TARGET_VERSION=1.6

source backup/settings.env
SOURCE_VERSION=${ZBR_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 reporting changes
if [[ ! -f reporting/.disabled ]] ; then
docker stop reporting-service
sleep 3
docker cp patch/sql/reporting-1.22-db-migration.sql postgres:/tmp
if [[ $? -ne 0 ]]; then
echo "ERROR! Unable to proceed upgrade as postgres container not available."
exit 1
fi
docker exec -i postgres /usr/bin/psql -U postgres -f /tmp/reporting-1.22-db-migration.sql
if [[ $? -ne 0 ]]; then
echo "ERROR! Unable to apply reporting-1.22-db-migration.sql"
exit 1
fi
fi

# #424: apply selenoid changes
cp selenoid/.env selenoid/.env_1.5
cp selenoid/.env.original selenoid/.env
if [[ ! $ZBR_MINIO_ENABLED -eq 1 ]]; then
# use case with AWS S3
replace selenoid/.env "S3_REGION=us-east-1" "S3_REGION=${ZBR_STORAGE_REGION}"
replace selenoid/.env "S3_ENDPOINT=http://minio:9000" "S3_ENDPOINT=${ZBR_STORAGE_ENDPOINT_PROTOCOL}://${ZBR_STORAGE_ENDPOINT_HOST}"
replace selenoid/.env "S3_BUCKET=zebrunner" "S3_BUCKET=${ZBR_STORAGE_BUCKET}"
replace selenoid/.env "S3_ACCESS_KEY_ID=zebrunner" "S3_ACCESS_KEY_ID=${ZBR_STORAGE_ACCESS_KEY}"
replace selenoid/.env "S3_SECRET=J33dNyeTDj" "S3_SECRET=${ZBR_STORAGE_SECRET_KEY}"

if [[ ! -z $ZBR_STORAGE_TENANT ]]; then
replace selenoid/.env "/artifacts" "${ZBR_STORAGE_TENANT}/artifacts"
fi
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
Loading