replace.sh 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/bash
  2. help(){
  3. echo "eg: $0 [old-string] [new-string] [old-dbType] [new-dbType]"
  4. echo ""
  5. exit 1
  6. }
  7. if [ ! -n "$1" ] ; then
  8. help
  9. fi
  10. if [ ! -n "$2" ] ; then
  11. help
  12. fi
  13. if [ ! -n "$3" ] ; then
  14. help
  15. fi
  16. if [ ! -n "$4" ] ; then
  17. help
  18. fi
  19. old_string=$1
  20. new_string=$2
  21. old_db_type=$3
  22. new_db_type=$4
  23. c_home=$(cd `dirname $0`; pwd)
  24. # 授权文件检查
  25. is_empty_dir(){
  26. return `ls -A $1|wc -w`
  27. }
  28. # ./license
  29. if is_empty_dir ${c_home}/license
  30. then
  31. echo "No license file!"
  32. echo ""
  33. exit 1
  34. fi
  35. if [ ! -f "${c_home}/license/ibpsPublic.store" ];then
  36. echo "No ibpsPublic.store license file!"
  37. echo ""
  38. exit 1
  39. fi
  40. if [ ! -f "${c_home}/license/ibpsVfy.lic" ];then
  41. echo "No ibpsVfy.lic license file!"
  42. echo ""
  43. exit 1
  44. fi
  45. # [后端网关IP]:[端口]
  46. sh ui.sh ${old_string}:15100 ${new_string}:35100
  47. sh ui-app.sh ${old_string}:15100 ${new_string}:35100
  48. # [后端platform服务IP]:[socket端口]
  49. sh ui.sh ${old_string}:15888 ${new_string}:35888
  50. sh ui-app.sh ${old_string}:15888 ${new_string}:35888
  51. sed -i "s/${old_string}/${new_string}/g" ${c_home}/docker-compose-data.yml
  52. sed -i "s/${old_string}/${new_string}/g" ${c_home}/conf/kibana.yml
  53. sed -i "s/${old_string}/${new_string}/g" ${c_home}/conf/logstash.conf
  54. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mysql-bpmn.xml
  55. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mssql-bpmn.xml
  56. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-oracle-bpmn.xml
  57. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-postgres-bpmn.xml
  58. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mysql-form.xml
  59. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mssql-form.xml
  60. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-oracle-form.xml
  61. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-postgres-form.xml
  62. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mysql-business.xml
  63. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mssql-business.xml
  64. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-oracle-business.xml
  65. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-postgres-business.xml
  66. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mysql-platform.xml
  67. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-mssql-platform.xml
  68. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-oracle-platform.xml
  69. sed -i "s/${old_string}/${new_string}/g" ${c_home}/datasource/datasource-postgres-platform.xml
  70. sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/ibps.sw.env
  71. sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/platform.docker.env
  72. sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/boot.docker.env
  73. sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/provider.docker.env
  74. sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/sw-oap.env
  75. sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/sw-ui.env
  76. sed -i "s/${old_string}/${new_string}/g" ${c_home}/env/sw-ui.env
  77. sed -i "s/${old_db_type}/${new_db_type}/g" ${c_home}/env/provider.docker.env
  78. sed -i "s/${old_db_type}/${new_db_type}/g" ${c_home}/docker-compose-app.yml