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

33 lines
1004 B
Bash

3 years ago
#!/bin/bash
3 years ago
#判断node.js mvn是否存在
command -v npm >/dev/null 2>&1 || { echo >&2 "I require node.js v14.16.0+ but it's not installed. Aborting."; sleep 5; exit 1; }
command -v mvn >/dev/null 2>&1 || { echo >&2 "I require maven 3.5 + but it's not installed. Aborting."; sleep 5; exit 1; }
3 years ago
cd `dirname $0`
BuildDir=`pwd` #工程根目录
echo "build web"
cd $BuildDir/report-ui
npm install >/dev/null 2>&1
npm run build:prod >/dev/null 2>&1
echo "publish web to springboot src/main/resources/static"
mv $BuildDir/report-ui/dist $BuildDir/report-core/src/main/resources/static
echo "build springboot"
cd $BuildDir/report-core
3 years ago
mvn clean >/dev/null 2>&1
mvn package -Dmaven.test.skip=true >/dev/null 2>&1
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/report-core-1.0.0-SNAPSHOT-assembly.zip $BuildDir/build/
3 years ago
3 years ago
3 years ago
cd $BuildDir/
3 years ago
rm -rf $BuildDir/report-core/src/main/resources/static
3 years ago
git reset --hard >/dev/null 2>&1