mirror of https://github.com/OpenVidu/openvidu.git
deployment: Update script of upgrading
- Throw error while upgrading between different OpenVidu Editions. - Move coturn volume to rollback directory while upgrading.pull/750/head
parent
7f1684fb78
commit
ace1a1f5a4
|
@ -133,6 +133,15 @@ upgrade_ov() {
|
|||
fatal_error "You can't update from version ${OPENVIDU_PREVIOUS_VERSION} to ${OPENVIDU_VERSION}.\nNever upgrade across multiple major versions."
|
||||
fi
|
||||
|
||||
# Check installation is a valid OpenVidu edition
|
||||
if grep -q '.*image:.*\/openvidu-server-pro:.*' "${OPENVIDU_PREVIOUS_FOLDER}/docker-compose.yml"; then
|
||||
if grep -q '.*image:.*\/replication-manager:.*' "${OPENVIDU_PREVIOUS_FOLDER}/docker-compose.yml"; then
|
||||
fatal_error "You can't upgrade. Installed version is OpenVidu Enterprise"
|
||||
else
|
||||
fatal_error "You can't upgrade. Installed version is OpenVidu PRO."
|
||||
fi
|
||||
fi
|
||||
|
||||
printf '\n'
|
||||
printf '\n ======================================='
|
||||
printf '\n Upgrade OpenVidu CE %s to %s' "${OPENVIDU_PREVIOUS_VERSION}" "${OPENVIDU_VERSION}"
|
||||
|
@ -219,6 +228,10 @@ upgrade_ov() {
|
|||
printf '\n - custom-nginx-locations'
|
||||
fi
|
||||
|
||||
if [ -d "${OPENVIDU_PREVIOUS_FOLDER}/coturn" ]; then
|
||||
mv "${OPENVIDU_PREVIOUS_FOLDER}/coturn" "${ROLL_BACK_FOLDER}" || fatal_error "Error while moving previous directory 'coturn'"
|
||||
fi
|
||||
|
||||
# Move tmp files to Openvidu
|
||||
printf '\n => Updating files:'
|
||||
|
||||
|
|
|
@ -196,6 +196,14 @@ upgrade_ov() {
|
|||
fatal_error "You can't update from version ${OPENVIDU_PREVIOUS_VERSION} to ${OPENVIDU_VERSION}.\nNever upgrade across multiple major versions."
|
||||
fi
|
||||
|
||||
# Check installation is a valid OpenVidu edition
|
||||
if grep -q '.*image:.*\/openvidu-server:.*' "${OPENVIDU_PREVIOUS_FOLDER}/docker-compose.yml"; then
|
||||
fatal_error "You can't upgrade. Installed version is OpenVidu CE"
|
||||
fi
|
||||
if grep -q '.*image:.*\/replication-manager:.*' "${OPENVIDU_PREVIOUS_FOLDER}/docker-compose.yml"; then
|
||||
fatal_error "You can't upgrade. Installed version is OpenVidu ENTERPRISE"
|
||||
fi
|
||||
|
||||
# If deployment has AWS_DEFAULT_REGION defined (deployed with cloudformation), check if new AMI of the media node is present as argument
|
||||
NEW_AMI_ID="${1:-}"
|
||||
AWS_REGION=$(get_previous_env_variable AWS_DEFAULT_REGION)
|
||||
|
@ -319,6 +327,10 @@ upgrade_ov() {
|
|||
printf '\n - custom-nginx-locations'
|
||||
fi
|
||||
|
||||
if [ -d "${OPENVIDU_PREVIOUS_FOLDER}/coturn" ]; then
|
||||
mv "${OPENVIDU_PREVIOUS_FOLDER}/coturn" "${ROLL_BACK_FOLDER}" || fatal_error "Error while moving previous directory 'coturn'"
|
||||
fi
|
||||
|
||||
# Move tmp files to Openvidu
|
||||
printf '\n => Updating files:'
|
||||
|
||||
|
|
Loading…
Reference in New Issue