|
|
7 years ago | |
|---|---|---|
| .. | ||
| bin | 7 years ago | |
| litemall-admin-api | 7 years ago | |
| litemall-os-api | 7 years ago | |
| litemall-wx-api | 7 years ago | |
| util | 7 years ago | |
| .gitignore | 7 years ago | |
| README.md | 7 years ago | |
项目进一步打包到deploy文件夹中:
使用FileZilla把deploy整个文件夹上传到云主机的/home/ubuntu文件夹中
使用PuTTY登录云主机
如果开发者没有部署litemall数据库,可以运行以下命令:
cd deploy
mysql -h localhost -u root -p123456
source ./litemall-db/litemall_schema.sql
source ./litemall-db/litemall.sql
注意,123456是开发者所设置的MySQL管理员密码 警告:
litemall_schema.sql会尝试删除litemall数据库然后重建一个新的数据。
运行脚本部署运行
sudo ./deploy/bin/deploy.sh
测试部署是否成功
请确保云主机的安全组已经允许相应的端口(见1.5.3.1); 然后测试是否部署成功(xxx.xxx.xxx.xxx是云主机IP):
http://xxx.xxx.xxx.xxx:8081/os/index/index
http://xxx.xxx.xxx.xxx:8082/wx/index/index
http://xxx.xxx.xxx.xxx:8083/admin/index/index
http://xxx.xxx.xxx.xxx:8080/#/login
部署脚本
为了简化步骤1和步骤2,完成了deploy/util/upload.sh上传脚本和deploy/util/lazy.sh部署脚本,
注意:
- 开发者需要在deploy/util/upload.sh和deploy/util/lazy.sh中设置相应的云主机登录账号和密钥文件路径。
- 开发者需要在deploy/util/reset.sh设置云主机的MySQL的root登录账户。
- 请先执行上述1-6步骤,确保部署环境成功。
该脚本会自动把当前项目不同模块下的最终部署文件复制到deploy文件夹中,然后上传到云主机。 该上传脚本没有自动做Spring Boot项目打包和Vue项目打包工作
该脚本会编译项目,再上传deploy文件,最后ssh登录远程主机执行bin下面的deploy.sh脚本。
注意,运行命令必须在项目主目录中,类似如下命令:
cd litemall
./deploy/util/lazy.sh