Improve scripts to run/deploy applications

This commit is contained in:
Gustavo Trott 2022-03-31 13:48:57 -03:00
parent 9659d2214b
commit 4ab9b9bc17
6 changed files with 70 additions and 9 deletions

13
akka-bbb-apps/deploy.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
cd "$(dirname "$0")"
sudo service bbb-apps-akka stop
sbt debian:packageBin
sudo dpkg -i target/bbb-apps-akka_*.deb
echo ''
echo ''
echo '----------------'
echo 'bbb-web updated'
sudo service bbb-apps-akka start
echo 'starting service bbb-web'

View File

@ -1,5 +1,14 @@
#!/usr/bin/env bash
sudo service bbb-apps-akka stop
rm -rf src/main/resources
cp -R src/universal/conf src/main/resources
exec sbt update run
#Set correct sharedSecret and bbbWebAPI
sudo sed -i "s/sharedSecret = \"changeme\"/sharedSecret = \"$(sudo bbb-conf --salt | grep Secret: | cut -d ' ' -f 6)\"/g" src/main/resources/application.conf
sudo sed -i "s/bbbWebAPI = \"https:\/\/192.168.23.33\/bigbluebutton\/api\"/bbbWebAPI = \"https:\/\/$(hostname -f)\/bigbluebutton\/api\"/g" src/main/resources/application.conf
#sbt update - Resolves and retrieves external dependencies, more details in https://www.scala-sbt.org/1.x/docs/Command-Line-Reference.html
#sbt ~reStart (instead of run) - run with "triggered restart" mode, more details in #https://github.com/spray/sbt-revolver
exec sbt update ~reStart

View File

@ -1,4 +1,5 @@
#!/bin/sh -ex
cd "$(dirname "$0")"
# Please check bigbluebutton/bigbluebutton-html5/dev_local_deployment/README.md
@ -6,7 +7,7 @@ UPPER_DESTINATION_DIR=/usr/share/meteor
DESTINATION_DIR=$UPPER_DESTINATION_DIR/bundle
SERVICE_FILES_DIR=/usr/lib/systemd/system
LOCAL_PACKAGING_DIR=/home/bigbluebutton/dev/bigbluebutton/build/packages-template/bbb-html5
LOCAL_PACKAGING_DIR="$(pwd)/../build/packages-template/bbb-html5"
if [ ! -d "$LOCAL_PACKAGING_DIR" ]; then
echo "Did not find LOCAL_PACKAGING_DIR=$LOCAL_PACKAGING_DIR"
@ -65,6 +66,8 @@ sudo chown -R meteor:meteor "$UPPER_DESTINATION_DIR"/
sudo chmod +x "$DESTINATION_DIR"/mongod_start_pre.sh
sudo chmod +x "$DESTINATION_DIR"/systemd_start.sh
sudo chmod +x "$DESTINATION_DIR"/systemd_start_frontend.sh
sudo cp $LOCAL_PACKAGING_DIR/workers-start.sh "$DESTINATION_DIR"/workers-start.sh
sudo chmod +x "$DESTINATION_DIR"/workers-start.sh

17
bigbluebutton-html5/run-dev.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
sudo systemctl stop bbb-html5 mongod
cd "$(dirname "$0")"
for var in "$@"
do
if [[ $var == --reset* ]] ; then
echo "Performing Meteor reset..."
rm -rf node_modules
meteor reset
meteor npm i
fi
done
npm start

View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
cd "$(dirname "$0")"
sudo service bbb-web stop
./build.sh
grails assemble
mkdir exploded && cd exploded
jar -xvf ../build/libs/bigbluebutton-0.10.0.war
cp ../run-prod.sh .
sudo cp -R /usr/share/bbb-web /usr/share/bbb-web-old
sudo rm -rf /usr/share/bbb-web/assets/ /usr/share/bbb-web/META-INF/ /usr/share/bbb-web/org/ /usr/share/bbb-web/run-prod.sh /usr/share/bbb-web/WEB-INF/
sudo cp -R . /usr/share/bbb-web/
sudo chown bigbluebutton:bigbluebutton /usr/share/bbb-web
sudo chown -R bigbluebutton:bigbluebutton /usr/share/bbb-web/assets/ /usr/share/bbb-web/META-INF/ /usr/share/bbb-web/org/ /usr/share/bbb-web/run-prod.sh /usr/share/bbb-web/WEB-INF/
echo ''
echo ''
echo '----------------'
echo 'bbb-web updated'
cd ..
sudo rm -r exploded
sudo service bbb-web start
echo 'starting service bbb-web'

View File

@ -1,10 +1,4 @@
#!/usr/bin/env bash
IS_BBB_WEB_RUNNING=`ss -lt | grep ":8090" > /dev/null && echo 1 || echo 0`
if [ "$IS_BBB_WEB_RUNNING" = "1" ]; then
echo "bbb-web is running, exiting"
exit 1
fi
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo " **** This is for development only *****"
@ -16,5 +10,6 @@ echo " chmod -R 777 /var/bigbluebutton/"
echo " "
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
sudo service bbb-web stop
exec grails prod run-app --port 8090
exec grails prod run-app --port 8090 -reloading