package.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. # 请注意
  3. # 本脚本的作用是把本项目编译的结果保存到deploy文件夹中
  4. # 1. 把项目数据库文件拷贝到docker/db/init-sql
  5. # 2. 编译litemall-admin
  6. # 3. 编译litemall-all模块,然后拷贝到docker/litemall
  7. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
  8. cd $DIR/../..
  9. LITEMALL_HOME=$PWD
  10. echo "LITEMALL_HOME $LITEMALL_HOME"
  11. # 复制数据库
  12. cat $LITEMALL_HOME/litemall-db/sql/litemall_schema.sql > $LITEMALL_HOME/docker/db/init-sql/litemall.sql
  13. cat $LITEMALL_HOME/litemall-db/sql/litemall_table.sql >> $LITEMALL_HOME/docker/db/init-sql/litemall.sql
  14. cat $LITEMALL_HOME/litemall-db/sql/litemall_data.sql >> $LITEMALL_HOME/docker/db/init-sql/litemall.sql
  15. # 安装阿里node镜像工具
  16. npm install -g cnpm --registry=https://registry.npm.taobao.org
  17. # 打包litemall-admin
  18. cd $LITEMALL_HOME/litemall-admin
  19. cnpm install
  20. cnpm run build:dep
  21. # 打包litemall-vue
  22. cd $LITEMALL_HOME/litemall-vue
  23. cnpm install
  24. cnpm run build:dep
  25. cd $LITEMALL_HOME
  26. mvn clean package
  27. cp -f $LITEMALL_HOME/litemall-all/target/litemall-all-*-exec.jar $LITEMALL_HOME/docker/litemall/litemall.jar