mirror of https://github.com/OpenVidu/openvidu.git
deployment: OpenVidu Pro - Add AMI as argument to upgrade script
parent
a39249eaaf
commit
47c4c91f7a
|
@ -185,6 +185,13 @@ upgrade_ov() {
|
|||
fatal_error "You can't update from version ${OPENVIDU_PREVIOUS_VERSION} to ${OPENVIDU_VERSION}.\nNever upgrade across multiple major versions."
|
||||
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)
|
||||
if [[ -n ${AWS_REGION} ]]; then
|
||||
[[ -z ${NEW_AMI_ID} ]] && fatal_error "You need to copy and specify an AMI Id for Media Nodes. Check https://docs.openvidu.io/en/${OPENVIDU_VERSION}/deployment/pro/upgrading/#option-2-update-current-deployment-to-2220"
|
||||
fi
|
||||
|
||||
printf '\n'
|
||||
printf '\n ======================================='
|
||||
printf '\n Upgrade OpenVidu Pro %s to %s' "${OPENVIDU_PREVIOUS_VERSION}" "${OPENVIDU_VERSION}"
|
||||
|
@ -368,12 +375,6 @@ upgrade_ov() {
|
|||
AWS_REGION=$(get_previous_env_variable AWS_DEFAULT_REGION)
|
||||
if [[ -n ${AWS_REGION} ]]; then
|
||||
|
||||
# Get new AMI ID
|
||||
NEW_AMI_ID=$(curl https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/CF-OpenVidu-Pro-${OPENVIDU_VERSION//v}.yaml --silent |
|
||||
sed -n -e '/KMSAMIMAP:/,/Metadata:/ p' |
|
||||
grep -A 1 "${AWS_REGION}" | grep AMI | tr -d " " | cut -d":" -f2)
|
||||
[[ -z ${NEW_AMI_ID} ]] && fatal_error "Error while getting new AWS_IMAGE_ID for Media Nodes"
|
||||
|
||||
# Get previous values
|
||||
PREV_AWS_DEFAULT_REGION=$(get_previous_env_variable AWS_DEFAULT_REGION)
|
||||
PREV_AWS_INSTANCE_TYPE=$(get_previous_env_variable AWS_INSTANCE_TYPE)
|
||||
|
@ -448,7 +449,7 @@ fi
|
|||
|
||||
# Check type of installation
|
||||
if [[ -n "$1" && "$1" == "upgrade" ]]; then
|
||||
upgrade_ov
|
||||
upgrade_ov "$2"
|
||||
else
|
||||
new_ov_installation
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue