build-MAth-Cloud.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #! /bin/bash
  2. curDir=`pwd`
  3. # Ask for the domain name to use
  4. echo -e "\033[92m*** Web site domain name ***\033[0m"
  5. currentDomain=`grep "hostname=='" ${curDir}/admin.ipsocloud.com/webapp_webpack/src/app.js |awk -F"'" '{ print $2 }' |sed 's/www.//'`
  6. echo "The current domain name is : ${currentDomain}"
  7. read -p "New domain name [${currentDomain}] : " domainName
  8. domainName=${domainName:-${currentDomain}}
  9. # Change the domain name if needed
  10. if [ ${domainName} != ${currentDomain} ];
  11. then
  12. echo "The domain name will be set to : ${domainName}"
  13. sed -i "s/$currentDomain/$domainName/g" ${curDir}/admin.ipsocloud.com/webapp_webpack/src/pages/customer.f7.html
  14. for i in admin cro www;
  15. do
  16. sed -i "s/$currentDomain/$domainName/g" ${curDir}/${i}.ipsocloud.com/webapp_webpack/src/app.js
  17. done
  18. for i in api cro www;
  19. do
  20. sed -i "s/$currentDomain/$domainName/g" ${curDir}/debian/Math-Cloud-server/etc/apache2/sites-available/${i}.conf
  21. done
  22. fi
  23. # Build MAth DLLs
  24. for i in math-imt math-plaque;
  25. do
  26. echo -e "\033[92m*** Build ${i} DLL ***\033[0m"
  27. cd ${curDir}/api.ipsocloud.com/${i}
  28. qmake
  29. make -j$(nproc --all) && cp ${i} ../bin/
  30. make clean
  31. done
  32. # Build ipsocloud web sites
  33. for i in admin cro www;
  34. do
  35. echo -e "\033[92m*** Build ${i}.ipsocloud.com web site***\033[0m"
  36. cd ${curDir}/${i}.ipsocloud.com/webapp_webpack/
  37. npm install
  38. npm run build-dev
  39. done
  40. # Create debian packages
  41. [ -x ${curDir}/debian/buildDeb.sh ] && cd ${curDir}/debian/ && ${curDir}/debian/buildDeb.sh
  42. cd ${curDir}