# bnt freemarker 模板来自[这个项目](https://github.com/langhsu/mblog) master 分支的 da0aec93 版本 ## 依赖 - os:Linux - jdk:11 - maven:3.9 - mysql:5.7 ## 模块 bnt 项目模块: - web > 监听 4030 HTTP 端口和 14030 RPC 端口 > > - console 模块 > > 作为 [oss](https://git.reghao.cn/reghao/oss) 项目的 oss-console 模块 > - blog 模块 > > 一个独立的 blog 服务 > - devops 模块 > > 一个独立的 devops 服务 ## 构建部署 ### pull 项目源码 ``` cd ~/Downloads git clone https://git.reghao.cn/reghao/bnt.git ``` ### 初始化 MySQL ``` cd ~/Downloads/bnt/zzz bash db_init.sh ``` > 执行 db_init.sh 会自动创建 bnt 项目需要的数据库并初始化数据库表 > > 需要自行指定 db_init.sh 脚本中的 host, username, password 等变量值 ### 构建并运行 ``` cd ~/Downloads/bnt/zzz bash build_jar.sh ``` > 执行 db_init.sh 会自动构建并运行 bntweb 应用 jar 包 > > build_jar.sh 脚本中的 proj_dir 变量默认是 ~/Downloads/bnt > > mvn 构建默认使用 dev 环境, 所以需要修改 web 模块 resources/application-dev.yml 配置文件中的第三方服务配置 > > 运行 bntweb 应用前需要根据环境修改 bnt/web/bin/bntweb.yml 文件中的配置 > > mysql 配置 > > 运行应用 > > 执行 bnt/web/bin/start.sh 脚本 > > > 使用 bntweb.yml 外部配置文件 > > > > 执行 bnt/web/bin/start1.sh 脚本 > > > 根据 mvn 打包选择的 profile, 使用 resources/application-dev.yml 或 resources/application-test.yml 内部配置文件 ### 停止应用 ``` cd ~/Downloads/bnt/web/bin bash shutdown.sh ``` > 执行 shutdown.sh 会结束 bntweb 应用