Skip to content

Commit

Permalink
Fix broken copy buttons, and create upgrading section for Enterprise …
Browse files Browse the repository at this point in the history
…HA On Premises
  • Loading branch information
cruizba committed Oct 20, 2023
1 parent a0d4c35 commit 516ed05
Show file tree
Hide file tree
Showing 8 changed files with 220 additions and 74 deletions.
6 changes: 4 additions & 2 deletions custom_theme/js/copy-btn.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
for (var i = 1; i < 14; i++) {

var buttonCopyList = $("[id^='btn-copy-']");

$('[data-toggle="tooltip"]').tooltip();
for (var i = 1; i <= buttonCopyList.length; i++) {
$('#btn-copy-' + i).bind('click', {id : i}, function (event) {
window.getSelection().empty();
var id = event.data.id;
Expand Down
4 changes: 2 additions & 2 deletions docs/deployment/ce/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ The deployment of OpenVidu can be a piece of cake if you have an AWS account. Ju

### 3. Option _Specify template__Amazon S3 URL_ with the following URL

<code id="code-2">https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/CF-OpenVidu-latest.yaml</code>
<button id="btn-copy-2" class="btn-xs btn-primary btn-copy-code hidden-xs" data-toggle="tooltip" data-placement="button"
<code id="code-1">https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/CF-OpenVidu-latest.yaml</code>
<button id="btn-copy-1" class="btn-xs btn-primary btn-copy-code hidden-xs" data-toggle="tooltip" data-placement="button"
title="Copy to Clipboard">Copy</button>

<p>
Expand Down
4 changes: 2 additions & 2 deletions docs/deployment/ce/on-premises.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ cd /opt
Now execute the following command to download and run the installation script.

<p style="text-align: start">
<code id="code-2">curl https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/install_openvidu_latest.sh | bash</code>
<button id="btn-copy-2" class="btn-xs btn-primary btn-copy-code hidden-xs" data-toggle="tooltip" data-placement="button"
<code id="code-1">curl https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/install_openvidu_latest.sh | bash</code>
<button id="btn-copy-1" class="btn-xs btn-primary btn-copy-code hidden-xs" data-toggle="tooltip" data-placement="button"
title="Copy to Clipboard">Copy</button>
</p>

Expand Down
4 changes: 2 additions & 2 deletions docs/deployment/ce/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ cd /opt/openvidu # Recommended and default installation path
Then you can run the upgrade script with the following command. Change the desired version in the URL: instead of <code>install_openvidu_<strong>VERSION</strong>.sh</code> use for example <code>install_openvidu_<strong>2.29.0</strong>.sh</code>

<p style="text-align: start">
<code id="code-3"><strong>curl https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/install_openvidu_VERSION.sh | bash -s upgrade</strong></code>
<button id="btn-copy-3" class="btn-xs btn-primary btn-copy-code hidden-xs" data-toggle="tooltip" data-placement="button"
<code id="code-1"><strong>curl https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/install_openvidu_VERSION.sh | bash -s upgrade</strong></code>
<button id="btn-copy-1" class="btn-xs btn-primary btn-copy-code hidden-xs" data-toggle="tooltip" data-placement="button"
title="Copy to Clipboard">Copy</button>
</p>

Expand Down
5 changes: 3 additions & 2 deletions docs/deployment/enterprise/on-premises.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ cd /opt
**4)** Now execute the following command to download and run the installation script:

<p style="text-align: start">
<code id="code-1"><strong>curl https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/install_openvidu_enterprise_ha_node_latest.sh | bash</strong></code>
<button id="btn-copy-1" class="btn-xs btn-primary btn-copy-code hidden-xs" data-toggle="tooltip" data-placement="button"
<code id="code-2"><strong>curl https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/install_openvidu_enterprise_ha_node_latest.sh | bash</strong></code>
<button id="btn-copy-2" class="btn-xs btn-primary btn-copy-code hidden-xs" data-toggle="tooltip" data-placement="button"
title="Copy to Clipboard">Copy</button>
</p>

Expand Down Expand Up @@ -674,3 +674,4 @@ For example, if you execute a GET request to `http://10.5.0.6:4443/openvidu/heal
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.20/jquery.fancybox.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.20/jquery.fancybox.min.js"></script>
<script type='text/javascript' src='js/fancybox-setup.js'></script>
<script src="js/copy-btn.js"></script>
39 changes: 39 additions & 0 deletions docs/deployment/enterprise/replace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# Check if a file path is provided
if [ $# -eq 0 ]
then
echo "No file path provided. Usage: ./script.sh <filepath>"
exit 1
fi

# The file to process
file="$1"

# Temporary file for intermediate processing
tempFile="temp.html"

# Counter for the incremental ids
counter=1

# Read the file line by line
while IFS= read -r line
do
# Check if the line contains the pattern
if echo "$line" | grep -q 'id="code-'
then
# Replace the pattern with the incremental id
line=$(echo "$line" | sed "s/id=\"code-[^\"']*/id=\"code-$counter/")
counter=$((counter+1))
fi
if echo "$line" | grep -q 'id="btn-copy-'
then
# Replace the pattern with the incremental id
line=$(echo "$line" | sed "s/id=\"btn-copy-[^\"']*/id=\"btn-copy-$((counter-1))/")
fi
# Write the line to the temporary file
echo "$line" >> "$tempFile"
done < "$file"

# Replace the original file with the temporary file
mv "$tempFile" "$file"
104 changes: 104 additions & 0 deletions docs/deployment/enterprise/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Depending of the type of deployment you have (_AWS_ or _On Premises_), you will
- **[Migrating from 2.28.0 to 2.29.0 (AWS Cloudformation - Single master deployment)](#migrating-from-2280-to-2290-aws-cloudformation-single-master-deployment)**
- **[Migrating from 2.28.0 to 2.29.0 (On premises - Single master deployment)](#migrating-from-2280-to-2290-on-premises-single-master-deployment)**
- **[Migrating from 2.28.0 to 2.29.0 (AWS Cloudformation - High Availability deployment)](#migrating-from-2280-to-2290-aws-cloudformation-high-availability-deployment)**
- **[Migrating from 2.28.0 to 2.29.0 (On Premises - High Availability deployment)](#migration-from-2280-to-2290-on-premises-high-availability-deployment)**

### Migrating from 2.28.0 to 2.29.0 (AWS Cloudformation - Single master deployment)
<br>
Expand Down Expand Up @@ -93,6 +94,109 @@ aws s3 sync s3://<bucket-v2.28.0> s3://<new-bucket-v2.29.0>

<br>

### Migration from 2.28.0 to 2.29.0 (On Premises - High Availability deployment)

First make sure to stop all the nodes of your cluster. Then, follow the next steps:

#### 1) Upgrading Base Services

If you are using in your On premises deployment the Base Services node, you will need to upgrade it first. Connect to the Base Services instance through SSH. Log with `root` permissions and go to OpenVidu installation path, by default `/opt/ov-enterprise-base-services`


```bash
sudo -s
cd /opt/ov-enterprise-base-services # Recommended and default installation path
```

Then you can run the upgrade script with this command:

<p style="text-align: start">
<code id="code-1"><strong>curl https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/install_ov_enterprise_ha_base_2.29.0.sh | bash -s upgrade</strong></code>
<button id="btn-copy-1" class="btn-xs btn-primary btn-copy-code hidden-xs" data-toggle="tooltip" data-placement="button"
title="Copy to Clipboard">Copy</button>
</p>

The installation steps will output their progress as they run. If everything goes well, at the end you will see a message with the final instructions to successfully complete the upgrade process:

```console
================================================
Openvidu Enterprise HA base services successfully upgraded to version v2.29.0
================================================

1. A new file 'docker-compose.yml' has been created with the new OpenVidu Enterprise HA v2.29.0 services

2. The previous file '.env' remains intact, but a new file '.env-v2.29.0' has been created.
Transfer any configuration you wish to keep in the upgraded version from '.env' to '.env-v2.29.0'.
When you are OK with it, rename and leave as the only '.env' file of the folder the new '.env-v2.29.0'.

3. If you were using Openvidu Call application, it has been automatically updated in file 'docker-compose.override.yml'.
However, if you were using your own application, a file called 'docker-compose.override.yml-v2.29.0'
has been created with the latest version of Openvidu Call. If you don't plan to use it you can delete it.

3. Start new versions of Openvidu Enterprise HA Base Services
------------------------------------------------
$ ./base-services start
------------------------------------------------

If you want to rollback, all the files from the previous installation have been copied to folder '.old-2.28.0'
```

After that, you can start the new version of OpenVidu Base Services with:

```console
./base-services start
```

<br>

#### 2) Upgrading OpenVidu Nodes


SSH to your OpenVidu Nodes with `root` permissions and go to OpenVidu installation path, by default `/opt/openvidu`:

```bash
sudo -s
cd /opt/openvidu # Recommended and default installation path
```

Then you can run the upgrade script with this command:

<p style="text-align: start">
<code id="code-2"><strong>curl https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/install_openvidu_enterprise_ha_node_2.29.0.sh | bash -s upgrade
</strong></code>
<button id="btn-copy-2" class="btn-xs btn-primary btn-copy-code hidden-xs" data-toggle="tooltip" data-placement="button"
title="Copy to Clipboard">Copy</button>
</p>

The installation steps will output their progress as they run. If everything goes well, at the end you will see a message with the final instructions to successfully complete the upgrade process:

```console
================================================
Openvidu Enterprise HA successfully upgraded to version v2.29.0
================================================

1. A new file 'docker-compose.yml' has been created with the new OpenVidu Enterprise HA v2.29.0 services

2. The previous file '.env' remains intact, but a new file '.env-v2.29.0' has been created.
Transfer any configuration you wish to keep in the upgraded version from '.env' to '.env-v2.29.0'.
When you are OK with it, rename and leave as the only '.env' file of the folder the new '.env-v2.29.0'.

3. Start new version of Openvidu
------------------------------------------------
$ ./openvidu start
------------------------------------------------

If you want to rollback, all the files from the previous installation have been copied to folder '.old-2.28.0'
```

Make sure that you have all of your needed properties at your .env file and start OpenVidu with:

```console
./openvidu start
```

<br>

## Migrating from 2.27.0 to 2.28.0

Depending of the type of deployment you have (_AWS_ or _On Premises_), you will need to follow one of the following instructions:
Expand Down
Loading

0 comments on commit 516ed05

Please sign in to comment.