-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
55 lines (49 loc) · 1.94 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
APP_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
WORKSPACE=${PWD}
echo 'current workspace:'
echo $WORKSPACE
cd src/main/webapp
# nvm install v16.13.1
node --version
npm --version
npm set registry https://registry.npm.taobao.org && \
npm set disturl https://npm.taobao.org/dist && \
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass && \
npm set electron_mirror https://npm.taobao.org/mirrors/electron && \
npm set puppeteer_download_host https://npm.taobao.org/mirrors && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver && \
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs && \
npm set selenium_cdnurl https://npm.taobao.org/mirrors/selenium && \
npm set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector && \
npm cache clean --force
echo 'current npm registry:'
npm get registry
npm install
npm run build
cd $WORKSPACE
chmod +x mvnw
# 打包
./mvnw clean package -DskipTests -V -e
# 安装提供给插件引用的pom
./mvnw install:install-file -Dfile=pom-parent.xml -DgroupId=com.terwergreen -DartifactId=bugucms-plugin-container -Dversion=${APP_VERSION} -Dpackaging=pom
# 配置环境并启动
echo "current user:"
whoami
#echo "stoping previous application..."
#sudo ./mvnw spring-boot:stop
#echo "previous application stoped."
#echo "starting previus application..."
#sudo ./mvnw spring-boot:run &
#echo "application started."
#echo "finish."
#export LANG=en_US.UTF-8
#export JAVA_HOME=/etc/java/java-1.8.0-openjdk/java-1.8.0-openjdk-1.8.0.272.b10-3.el8_3.x86_64
#export PATH=$JAVA_HOME/bin:$PATH
#export MALLOC_ARENA_MAX=4
#JAVA_OPTS="-server -Xms1024m -Xmx1024m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=512m -XX:MaxNewSize=512m -XX:SurvivorRatio=8"
APP_PATH=$WORKSPACE/target
cd $APP_PATH
pwd
chmod +x classes/springboot.sh
sh classes/springboot.sh restart