OnlineJudgeFE/deploy/run.sh

23 lines
383 B
Bash
Raw Normal View History

2017-10-24 13:16:00 +00:00
#!/bin/sh
2017-11-13 13:28:21 +00:00
base=/OJ_FE
2017-10-24 13:16:00 +00:00
build_vendor_dll()
{
if [ ! -e "${base}/build/vendor-manifest.json" ]
then
npm run build:dll
fi
2017-10-24 13:16:00 +00:00
}
cd $base
npm install --registry=https://registry.npm.taobao.org && \
build_vendor_dll && \
npm run build
2017-10-24 13:16:00 +00:00
if [ $? -ne 0 ]; then
echo "Build error, please check node version and package.json"
exit 1
fi
2017-10-24 13:16:00 +00:00
exec nginx -c /OJ_FE/deploy/nginx.conf