#!/bin/bash ############################################################################### # 构建 bnt 应用 ############################################################################### set -e proj_dir='~/Downloads/bnt' ############################################################################### # 构建依赖 ############################################################################### build_dependencies() { cd ${proj_dir} git clone https://git.reghao.cn/reghao/jutil cd jutil mvn clean install -Dmaven.test.skip=true cd ${proj_dir} git clone https://git.reghao.cn/reghao/oss cd oss mvn clean install -Dmaven.test.skip=true -pl oss/oss-sdk } ############################################################################### # 构建 bnt 应用 jar 包 ############################################################################### build_jar() { cd ${proj_dir} mvn clean package -Dmaven.test.skip } ############################################################################### # 运行 bnt 应用 ############################################################################### exec_jar() { cd ${proj_dir}/web/bin bash start.sh } ############################################################################### # 构建 bnt 应用镜像 ############################################################################### build_image() { commit_id=`git rev-parse HEAD | cut -c 1-8` docker_prefix='bnt' cd ${proj_dir}/bnt/web/ docker build -t ${docker_prefix}/gateway:${commit_id} . } exec_image() { echo "not implement..." } echo "构建第三方依赖..." build_dependencies echo "构建 bnt jar 应用..." build_jar echo "运行 bnt jar 应用..." exec_jar