Merge branch 'master' of https://github.com/OpenVidu/openvidu-tutorials
This commit is contained in:
commit
ab10187960
@ -1,56 +0,0 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
echo "## Updating openvidu-tutorials"
|
||||
|
||||
find -type f -name 'package-lock.json' -exec rm {} \;
|
||||
find -type d -name 'node_modules' -exec rm -rf {} \;
|
||||
|
||||
# Updating openvidu-browser dependencies in package.json files [openvidu-insecure-angular, openvidu-insecure-react, openvidu-ionic, openvidu-react-native]
|
||||
find . -type f -name 'package.json' -not \( -path '*/node_modules/*' -o -path '*/package-lock.json' \) -exec sed -i "s/\"openvidu-browser\": \"$FROM_VERSION\"/\"openvidu-browser\": \"$TO_VERSION\"/" {} \;
|
||||
|
||||
# Updating openvidu-react dependencies in package.json files [openvidu-library-react]
|
||||
find . -type f -name 'package.json' -not \( -path '*/node_modules/*' -o -path '*/package-lock.json' \) -exec sed -i "s/\"openvidu-react\": \"$FROM_VERSION\"/\"openvidu-react\": \"$TO_VERSION\"/" {} \;
|
||||
|
||||
# Updating openvidu-angular dependencies in package.json files [openvidu-library-angular]
|
||||
find . -type f -name 'package.json' -not \( -path '*/node_modules/*' -o -path '*/package-lock.json' \) -exec sed -i "s/\"openvidu-angular\": \"$FROM_VERSION\"/\"openvidu-angular\": \"$TO_VERSION\"/" {} \;
|
||||
|
||||
# Updating openvidu-node-client dependencies in package.json files [openvidu-js-node, openvidu-mvc-node, openvidu-recording-node]
|
||||
find . -type f -name 'package.json' -not \( -path '*/node_modules/*' -o -path '*/package-lock.json' \) -exec sed -i "s/\"openvidu-node-client\": \"$FROM_VERSION_SDK\"/\"openvidu-node-client\": \"$TO_VERSION_SDK\"/" {} \;
|
||||
|
||||
# Updating openvidu-java-client dependencies in pom.xml files [openvidu-js-java, openvidu-mvc-java, openvidu-recording-java, openvidu-ipcameras]
|
||||
for tutorial in openvidu-js-java openvidu-mvc-java openvidu-recording-java openvidu-ipcameras; do
|
||||
cd $tutorial && mvn versions:use-latest-releases -Dincludes=io.openvidu:openvidu-java-client && cd ..
|
||||
done
|
||||
|
||||
# Run "npm install" in every npm project [openvidu-insecure-angular, openvidu-insecure-react, openvidu-library-angular, openvidu-library-react, openvidu-ionic, openvidu-js-node, openvidu-mvc-node, openvidu-recording-node, openvidu-react-native, openvidu-electron]
|
||||
for tutorial in openvidu-insecure-angular openvidu-insecure-react openvidu-library-angular openvidu-library-react openvidu-ionic openvidu-js-node openvidu-mvc-node openvidu-recording-node openvidu-react-native openvidu-electron; do
|
||||
cd $tutorial && npm install && cd ..
|
||||
done
|
||||
|
||||
# Update every <script src="openvidu-browser-VERSION.js"></script> import in every *.html or *.ejs file (14 files changed)
|
||||
for file in *.html *.ejs; do
|
||||
find . -type f -name $file -not \( -path '*/node_modules/*' -o -path '*/package-lock.json' \) -exec sed -i "s/<script src=\"openvidu-browser-$FROM_VERSION.js\"><\/script>/<script src=\"openvidu-browser-$TO_VERSION.js\"><\/script>/" {} \;
|
||||
done
|
||||
|
||||
# Update every openvidu-browser-VERSION.js file (13 FILES CHANGED)
|
||||
wget https://github.com/OpenVidu/openvidu/releases/download/v$TO_VERSION/openvidu-browser-$TO_VERSION.js
|
||||
readarray array < <(find -name "openvidu-browser-$FROM_VERSION.js" -printf "%h\n" | sort -u)
|
||||
for directory in ${array[@]}; do
|
||||
echo "Updating $directory/openvidu-browser-$FROM_VERSION.js to openvidu-browser-$TO_VERSION.js"
|
||||
rm $directory/openvidu-browser-$FROM_VERSION.js
|
||||
cp openvidu-browser-$TO_VERSION.js $directory/openvidu-browser-$TO_VERSION.js
|
||||
done
|
||||
rm openvidu-browser-$TO_VERSION.js
|
||||
|
||||
# Update openvidu-webcomponent tutorial files: static web component files and import in index.html
|
||||
wget https://github.com/OpenVidu/openvidu/releases/download/v$TO_VERSION/openvidu-webcomponent-$TO_VERSION.zip
|
||||
mkdir openvidu-webcomponent-$TO_VERSION
|
||||
mv openvidu-webcomponent-$TO_VERSION.zip openvidu-webcomponent-$TO_VERSION/openvidu-webcomponent-$TO_VERSION.zip
|
||||
unzip openvidu-webcomponent-$TO_VERSION/openvidu-webcomponent-$TO_VERSION.zip -d openvidu-webcomponent-$TO_VERSION/.
|
||||
rm openvidu-webcomponent/web/openvidu-webcomponent-$FROM_VERSION.js
|
||||
rm openvidu-webcomponent/web/openvidu-webcomponent-$FROM_VERSION.css
|
||||
mv openvidu-webcomponent-$TO_VERSION/openvidu-webcomponent-$TO_VERSION.js openvidu-webcomponent/web/.
|
||||
mv openvidu-webcomponent-$TO_VERSION/openvidu-webcomponent-$TO_VERSION.css openvidu-webcomponent/web/.
|
||||
rm -rf openvidu-webcomponent-$TO_VERSION
|
||||
sed -i "s/<script src=\"openvidu-webcomponent-$FROM_VERSION.js\"><\/script>/<script src=\"openvidu-webcomponent-$TO_VERSION.js\"><\/script>/" openvidu-webcomponent/web/index.html
|
||||
sed -i "s/<link rel=\"stylesheet\" href=\"openvidu-webcomponent-$FROM_VERSION.css\">/<link rel=\"stylesheet\" href=\"openvidu-webcomponent-$TO_VERSION.css\">/" openvidu-webcomponent/web/index.html
|
||||
@ -1,7 +1,50 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
if [[ -z "$FROM_VERSION" || -z "$TO_VERSION" ]]; then
|
||||
echo
|
||||
echo "Examples of use: "
|
||||
echo " FROM_VERSION=2.12.0 TO_VERSION=2.13.0 ${0}"
|
||||
echo " FROM_VERSION=2.12.0 TO_VERSION=2.13.0 FROM_VERSION_SDK=2.12.0 TO_VERSION_SDK=2.13.0 ${0}"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "$FROM_VERSION_SDK" || -z "$TO_VERSION_SDK" ]]; then
|
||||
echo
|
||||
echo "No FROM_VERSION_SDK and TO_VERSION_SDK properties provided. Server SDKs depdendencies won't be updated."
|
||||
echo "To update also server SDKs dependencies, run the script like this:"
|
||||
echo " FROM_VERSION=2.12.0 TO_VERSION=2.13.0 FROM_VERSION_SDK=2.12.0 TO_VERSION_SDK=2.13.0 ${0}"
|
||||
echo
|
||||
read -p "Do you still want to continue? [Y/N]" -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then :
|
||||
else
|
||||
echo "Aborted"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "## Updating openvidu-tutorials"
|
||||
echo
|
||||
|
||||
NPM_TUTORIALS="openvidu-insecure-angular
|
||||
openvidu-insecure-react
|
||||
openvidu-library-angular
|
||||
openvidu-library-react
|
||||
openvidu-ionic
|
||||
openvidu-js-node
|
||||
openvidu-mvc-node
|
||||
openvidu-recording-node
|
||||
openvidu-react-native
|
||||
openvidu-electron"
|
||||
|
||||
MAVEN_TUTORIALS="openvidu-js-java
|
||||
openvidu-mvc-java
|
||||
openvidu-recording-java
|
||||
openvidu-ipcameras"
|
||||
|
||||
# Delete all package-lock.json and node_modules
|
||||
find -type f -name 'package-lock.json' -exec rm {} \;
|
||||
find -type d -name 'node_modules' -exec rm -rf {} \;
|
||||
|
||||
@ -14,26 +57,68 @@ find . -type f -name 'package.json' -not \( -path '*/node_modules/*' -o -path '*
|
||||
# Updating openvidu-angular dependencies in package.json files [openvidu-library-angular]
|
||||
find . -type f -name 'package.json' -not \( -path '*/node_modules/*' -o -path '*/package-lock.json' \) -exec sed -i "s/\"openvidu-angular\": \"$FROM_VERSION\"/\"openvidu-angular\": \"$TO_VERSION\"/" {} \;
|
||||
|
||||
# Run "npm install" in every npm project [openvidu-insecure-angular, openvidu-insecure-react, openvidu-library-angular, openvidu-library-react, openvidu-ionic, openvidu-js-node, openvidu-mvc-node, openvidu-recording-node]
|
||||
for tutorial in openvidu-insecure-angular openvidu-insecure-react openvidu-library-angular openvidu-library-react openvidu-ionic openvidu-js-node openvidu-mvc-node openvidu-recording-node; do
|
||||
# If server SDKs must be udpated
|
||||
if [[ -n "$FROM_VERSION_SDK" && -n "$TO_VERSION_SDK" ]]; then
|
||||
|
||||
# Updating openvidu-node-client dependencies in package.json files [openvidu-js-node, openvidu-mvc-node, openvidu-recording-node]
|
||||
find . -type f -name 'package.json' -not \( -path '*/node_modules/*' -o -path '*/package-lock.json' \) -exec sed -i "s/\"openvidu-node-client\": \"$FROM_VERSION_SDK\"/\"openvidu-node-client\": \"$TO_VERSION_SDK\"/" {} \;
|
||||
|
||||
# Updating openvidu-java-client dependencies in pom.xml files
|
||||
for tutorial in ${MAVEN_TUTORIALS}
|
||||
do
|
||||
cd $tutorial && mvn --batch-mode versions:use-dep-version -Dincludes=io.openvidu:openvidu-java-client -DdepVersion=$TO_VERSION_SDK -DforceVersion=true && cd ..
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
# Run "npm install" in every NPM project
|
||||
for tutorial in ${NPM_TUTORIALS}
|
||||
do
|
||||
echo "###############################"
|
||||
echo "Compiling NPM project $tutorial"
|
||||
echo "###############################"
|
||||
echo
|
||||
cd $tutorial && npm install && cd ..
|
||||
done
|
||||
|
||||
# Update every <script src="openvidu-browser-VERSION.js"></script> import in every *.html or *.ejs file (13 files changed)
|
||||
# Run "mvn clean compile package" in every Maven project
|
||||
for tutorial in ${MAVEN_TUTORIALS}
|
||||
do
|
||||
echo "###############################"
|
||||
echo "Compiling Maven project $tutorial"
|
||||
echo "###############################"
|
||||
echo
|
||||
cd $tutorial && mvn clean compile package && cd ..
|
||||
done
|
||||
|
||||
# Update every <script src="openvidu-browser-VERSION.js"></script> import in every *.html or *.ejs file (14 files changed)
|
||||
for file in *.html *.ejs; do
|
||||
echo "###############################"
|
||||
echo "Updating openvidu-browser <script> tag in $file"
|
||||
echo "###############################"
|
||||
echo
|
||||
find . -type f -name $file -not \( -path '*/node_modules/*' -o -path '*/package-lock.json' \) -exec sed -i "s/<script src=\"openvidu-browser-$FROM_VERSION.js\"><\/script>/<script src=\"openvidu-browser-$TO_VERSION.js\"><\/script>/" {} \;
|
||||
done
|
||||
|
||||
# Update every openvidu-browser-VERSION.js file (13 FILES CHANGED)
|
||||
wget https://github.com/OpenVidu/openvidu/releases/download/v$TO_VERSION/openvidu-browser-$TO_VERSION.js
|
||||
readarray array < <(find -name "openvidu-browser-$FROM_VERSION.js" -printf "%h\n" | sort -u)
|
||||
for directory in ${array[@]}; do
|
||||
readarray MY_ARRAY < <(find -name "openvidu-browser-$FROM_VERSION.js" -printf "%h\n" | sort -u)
|
||||
for directory in ${MY_ARRAY[@]}
|
||||
do
|
||||
echo "###############################"
|
||||
echo "Replacing $directory/openvidu-browser-$FROM_VERSION.js with openvidu-browser-$TO_VERSION.js"
|
||||
echo "###############################"
|
||||
echo
|
||||
rm $directory/openvidu-browser-$FROM_VERSION.js
|
||||
cp openvidu-browser-$TO_VERSION.js $directory/openvidu-browser-$TO_VERSION.js
|
||||
done
|
||||
rm openvidu-browser-$TO_VERSION.js
|
||||
|
||||
# Update openvidu-webcomponent tutorial files: static web component files and import in index.html
|
||||
# Update openvidu-webcomponent tutorial files: static web component files and import inside index.html
|
||||
|
||||
echo "###############################"
|
||||
echo "Updating openvidu-webcomponent tutorial"
|
||||
echo "###############################"
|
||||
wget https://github.com/OpenVidu/openvidu/releases/download/v$TO_VERSION/openvidu-webcomponent-$TO_VERSION.zip
|
||||
mkdir openvidu-webcomponent-$TO_VERSION
|
||||
mv openvidu-webcomponent-$TO_VERSION.zip openvidu-webcomponent-$TO_VERSION/openvidu-webcomponent-$TO_VERSION.zip
|
||||
@ -45,4 +130,3 @@ mv openvidu-webcomponent-$TO_VERSION/openvidu-webcomponent-$TO_VERSION.css openv
|
||||
rm -rf openvidu-webcomponent-$TO_VERSION
|
||||
sed -i "s/<script src=\"openvidu-webcomponent-$FROM_VERSION.js\"><\/script>/<script src=\"openvidu-webcomponent-$TO_VERSION.js\"><\/script>/" openvidu-webcomponent/web/index.html
|
||||
sed -i "s/<link rel=\"stylesheet\" href=\"openvidu-webcomponent-$FROM_VERSION.css\">/<link rel=\"stylesheet\" href=\"openvidu-webcomponent-$TO_VERSION.css\">/" openvidu-webcomponent/web/index.html
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user