-
Notifications
You must be signed in to change notification settings - Fork 89
Автоматическое обновление MyController с GitHub (ru ru)
arturmon edited this page Jan 24, 2016
·
7 revisions
- Останавливает службу MyController
- Загружает с GitHub исходники
- Компилирует mvn
- удаляет старые папки с MyController
- Распаковывает скомпилированный образ *.tar.gz в корень диска
- Удаляет ненужный *.bat и запускает службу MyController
git clone https://github.com/andsel/moquette
cd moquette
mvn package install
git clone https://github.com/twilio/twilio-java
cd twilio-java
mvn install
maven (установлен в /opt)
git
JDK 1.8
TargetFolder= Куда копируются файлы после компиляции
ToTargetFolder= Куда будет установлен MySensors
FileConfig= Имя файла конфигурации
FolderFileConf= Папка где лежит файл конфигурации
#!/bin/bash
clear
TargetFolder=/home/genius/old_mycontroller/target/
ToTargetFolder=/mycontroller
FileConfig=mycontroller.properties
FolderFileConf=/home/genius/
echo -e "\e[32m[----------][`date +%F--%H-%M`]---------- Stop Sevice MyController----------------------------------------\033[0m"
sh $ToTargetFolder/bin/stop.sh
echo -e "\e[31m[----------][`date +%F--%H-%M`]---------- REMOUTE FILE!!!!!-----------------------------------------------\033[0m"
rm -R /home/genius/mycontroller
rm -R /home/genius/old_mycontroller
echo -e "\e[32m[+---------][`date +%F--%H-%M`]---------- Add Patch Maven-------------------------------------------------\033[0m"
export PATH=/opt/apache-maven-3.3.3/bin:$PATH
echo -e "\e[32m[+---------][`date +%F--%H-%M`]---------- PATH:\033[0m"$PATH
echo -e "\e[32m[++--------][`date +%F--%H-%M`]---------- Git Clone-------------------------------------------------------\033[0m"
git clone https://github.com/mycontroller-org/mycontroller.git
cd mycontroller
echo -e "\e[32m[++++------][`date +%F--%H-%M`]---------- Compile Mycontroller.org----------------------------------------\033[0m"
mvn package
echo -e "\e[32m[+++++-----][`date +%F--%H-%M`]---------- Copy to New Folder----------------------------------------------\033[0m"
cp -R /home/genius/mycontroller /home/genius/old_mycontroller
echo -e "\e[31m[++++++----][`date +%F--%H-%M`]---------- Clear Compile---------------------------------------------------\033[0m"
rm -R /home/genius/mycontroller
echo -e "\e[32m---------- TargetFolder: $TargetFolder\033[0m"
echo -e "\e[32m---------- Extract Arhive : $TargetFolder\033[0m"
echo -e "\e[32m---------- to: $ToTargetFolder\033[0m"
echo -e "\e[32m[+++++++---][`date +%F--%H-%M`]---------- Remoute Folder $ToTargetFolder----------------------------------\033[0m"
rm -R /mycontroller
echo -e "\e[32m[+++++++---][`date +%F--%H-%M`]---------- Create New Folder $ToTargetFolder-------------------------------\033[0m"
mkdir -vp $ToTargetFolder
echo -e "\e[32m[++++++++--][`date +%F--%H-%M`]---------- Ecstracte Archive ----------------------------------------------\033[0m"
tar -vxzf `find $TargetFolder*.tar.gz` -C /
echo -e "\e[32m[+++++++++-][`date +%F--%H-%M`]---------- Copy $FileConfig to Folder MyController-------------------------\033[0m"
cp -v $FolderFileConf$FileConfig $ToTargetFolder/conf/$FileConfig
rm $ToTargetFolder/bin/start.bat
echo -e "\e[35m[++++++++++][`date +%F--%H-%M`]---------- GOOOOOOD -------------------------------------------------------\033[0m"
sed 's/Xmx40m/Xmx512m/g' -i $ToTargetFolder/bin/start.sh
$ToTargetFolder/bin/start.sh &
echo -e "\e[35m[++++++++++][`date +%F--%H-%M`]---------- Start Service MyController--------------------------------------\033[0m"
service smbd restart
SETTINGS=`stty -g`
stty -echo
read -n 1
stty $SETTINGS
- Autostart Server
- Config file
- Select gateway
- Serial Gateway
- Ethernet Gateway
- MQTT Gateway
- Database
- Webserver
- Logger
- Start/Stop Server
- Settings
- Nodes
- Auto Discover
- Add Manually
- Reboot
- Erase EEPROM
- Edit
- Delete
- Battery Usage Report
- Mapping Firmware
- Update Firmware
- Action Board
- Filter
- Filter by node
- Filter by text
- Refresh
- Buttons
- Buttons On/Off
- Buttons Send Payload
- Buttons Lock/Unlock
- Buttons RGB and RGBW
- Other Buttons
- Graphical Report
- Timer
- Alarm
- Forward Payload