You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tanghe-report/build.sh

39 lines
1018 B
Bash

3 years ago
#!/bin/bash
3 years ago
echo "判断node.js mvn是否存在"
command -v npm || { echo >&2 "I require node.js v14.16.0+ but it's not installed. Aborting."; sleep 5; exit 1; }
command -v mvn || { echo >&2 "I require maven 3.5 + but it's not installed. Aborting."; sleep 5; exit 1; }
3 years ago
3 years ago
cd `dirname $0`
BuildDir=`pwd` #工程根目录
echo "build web"
cd $BuildDir/report-ui
echo "npm install"
npm install
echo ""
echo "npm run build"
npm run build:prod
3 years ago
echo "publish web to springboot src/main/resources/static"
3 years ago
3 years ago
mkdir -p $BuildDir/report-core/src/main/resources/static
mv $BuildDir/report-ui/dist/* $BuildDir/report-core/src/main/resources/static/
3 years ago
echo ""
3 years ago
echo "build springboot"
cd $BuildDir/report-core
echo "mvn clean"
mvn clean
echo ""
echo "mvn package"
mvn package -Dmaven.test.skip=true
3 years ago
echo "zip finish in build dir"
3 years ago
if [ ! -d "$BuildDir/build" ]; then
mkdir $BuildDir/build
fi
3 years ago
mv $BuildDir/report-core/target/aj-report-*.zip $BuildDir/build/
3 years ago
rm -rf $BuildDir/report-core/src/main/resources/static/*
echo "Finish"