Skip to content
This repository has been archived by the owner on Apr 10, 2022. It is now read-only.

Latest commit

 

History

History
122 lines (91 loc) · 3.14 KB

get-started.adoc

File metadata and controls

122 lines (91 loc) · 3.14 KB

Get Started

开发手册

  • 初次准备:

    • 数据库数据初始化,执行 /bin/sql/ 路径下的 SQL 脚本

    • 修改 app-version-managerapp-version-rest 模块中的 resources 路径下的 mysql 和 redis 配置信息

    • 修改 web/dashboard/.env.development 文件中的相应配置

  • 启动项目(开发环境):

    • 启动后端:

      • 管理系统模块(app-version-manager): 启动类AppVersionManagerApplication

      • REST接口模块(app-version-rest): 启动类AppVersionRestApplication

    • 启动前端:

      • 注意修改目录下 .env.development 文件内的 VUE_APP_HTTP_API 值为自己部署的 管理系统模块 的IP(如果使用域名,请改为<http(s)://域名/manager> ),以及阿里云OSS的相关配置(APK包上传使用的是OSS存储)
        关于不同环境的配置请参考 vue-cli-service

        cd web/dashboard
        yarn install
        yarn serve
Note
若遇到无法正常启动模块服务,请先尝试 install 基础模块 app-version-common

部署手册

环境相关

推荐配置:

  • JDK: 1.8.0_144

  • Node: 8.11.4

  • Mysql: 5.7.18

  • Redis: 3.2.10

Warning
高版本 Mysql 存在一些特性的不再支持的情况。

后端部署

  • 用 Maven 打包

git clone https://github.com/xtTech/app-version.git

sh ./build.sh

生成的jar包的位置:

./modules/app-version-manager/target/app-version-manager.jar
./modules/app-version-manager/target/app-version-rest.jar
  • 启动项目

启动脚本为: spring.sh 将脚本和打出的jar包放在同级目录下,执行

./spring.sh start
./spring.sh start
Note
spring.sh 脚本需要根据实际情况修改 app 参数,详细参见注释
Tip
注意修改各模块yml文件中相关的mysql、redis的连接配置

前端部署

前端打包:

cd web/dashboard

npm install

# 这里以生产为例,还存在 development、test、uat
npm run build:prod  # 使用此命令,请修改.env.production文件中的配置

然后会在 dashboard 目录下生成一个 dist 文件夹,将文件夹下内容复制到 nginx 的 html 文件夹内。 参考以下内容配置你的 nginx 的 nginx.conf 文件。

http {
    # 省略其他参数...
    server {
	   listen 80;
	   server_name app.com;    # 指定域名
	   location / {
			 try_files $uri $uri/ /index.html;
			 index index.html;
			 root /data/static/;   # 前端打包后的存储位置,注意,要根据自己的 Nginx 相应变动,不是所有的都是这个路径下哦
			 allow all;
	   }
	   location ^~ /rest/ {
			charset utf-8;
			default_type application/json;
			proxy_pass http://localhost:8084/;   # 访问Rest接口Java后台
	   }
	   location ^~ /manager/ {
			proxy_pass http://localhost:8086/;     # 访问管理平台接口Java后台
	   }
	}
    # 省略其他参数...
}
Tip

注意修改env文件的配置,Nginx 配置需要根据自己的实际情况进行修改,这里只是一个参考。