Pre Merge pull request !128 from 刘子龙2011/dev

This commit is contained in:
刘子龙2011 2022-01-06 09:21:36 +00:00 committed by Gitee
commit ce59c94a8e

29
ruoyi-ui/bin/build.sh Normal file
View File

@ -0,0 +1,29 @@
#!/bin/bash
cd .. || exit
workdir=$(cd $(dirname $0) || exit; pwd)
echo "current dir:$workdir"
npm install --registry=https://registry.npm.taobao.org
npm run build:prod
if [ ! -d "dist/" ];then
echo "npm build failed"; exit 1;
else
echo "npm build success"
fi
cd /docker/nginx || exit
if [ ! -d "html/" ];then
mkdir html
else
current_time=$(date "+%Y%m%d%H%M%S")
dir="html_bak_${current_time}"
mkdir "$dir"
mv /docker/nginx/html/* "$dir"
echo "old file backup to:$dir"
fi
cd "$workdir" || exit
cp -r dist/* /docker/nginx/html/
echo "DONE"