springboot项目简单启动脚本
#!/bin/bash
function log_info () {
DATE=`date "+%Y-%m-%d %H:%M:%S"`
USER=$(whoami)
echo "${DATE} ${USER} execute $0 [INFO] $@"
}
function log_error ()
{
DATE=`date "+%Y-%m-%d %H:%M:%S"`
USER=$(whoami)
echo "${DATE} ${USER} execute $0 [ERROR] $@"
}
function fn_log ()
{
if [ $? -eq 0 ]; then
log_info "$@ sucessed!"
else
log_error "$@ failed!"
exit
fi
}
# cd 51token
# git pull
# cd token-api
# get pid
# kill pid
# mvn clean package
# cd target
# nohup java -jar ... >/dev/null &
APP="token-api-0.0.1-SNAPSHOT.jar"
cd ~/51token
git pull
fn_log "git pull"
sleep 3
cd token-api
PID=`ps -C java -f | grep $APP | awk '{print $2}'`
fn_log "ps -C java -f | grep $APP | awk '{print $2}"
if [ -n "$PID" ]; then
kill 9 $PID
fn_log "kill 9 $PID"
fi
sleep 2
mvn clean package
fn_log "mvn clean package"
sleep 5
cd target
if [ -f "$APP" ]; then
nohup java -jar $APP >/dev/null &
fn_log "nohup java -jar $APP >/dev/null &"
else
echo "package not exist"
exit
fi
ss -tlnp
COUNT=15
while [ $COUNT -gt 0 ]; do
echo "wait"
COUNT=`expr $COUNT "-" 1`
sleep 1
done
ss -tlnp
springboot项目简单启动脚本的更多相关文章
- SpringBoot项目快速启动停止脚本
SpringBoot项目快速启动停止脚本 1.在jar包同级目录下,创建 app.sh #!/bin/bash appName=`ls|grep .jar$` if [ -z $appName ] t ...
- SpringBoot -- 项目结构+启动流程
一.简述: 项目结构 二.简述:启动流程 说springboot的启动流程,当然少不了springboot启动入口类 @SpringBootApplication public class Sprin ...
- 因默认包扫描问题导致的SpringBoot项目无法启动问题
启动SpringBoot项目的时候,提示如下信息: -- :: --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing or ...
- springboot项目突然启动缓慢
在项目快到最后的时候,有一次在本地启动项目的时候,突然发现项目启动起来特别的慢. 刚开始也不知道哪里出了问题,只能慢慢的查原因. springboot项目在debug模式下本来运行的挺快,后来某一天突 ...
- SpringBoot项目jar启动端口设置
SpringBoot项目打包后,在target下生成的jar文件可以使用 Java - jar 直接启动,指定端口号配置 java -jar epjs-eureka.jar --server.port ...
- 【排错】springboot项目,启动报An attempt was made to call the method com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder; but it does not exist.
pom文件新引入: <dependency> <groupId>com.google.code.gson</groupId> ...
- eclipse中创建的spring-boot项目在启动时指定加载那一个配置文件的设置
步骤如下:鼠标点击项目右键—>Run As—>Run Configurations—>Java Application (如下图) 鼠标右键点击Java Application——— ...
- IDEA导入springboot项目不能启动
由于工具没有识别到项目的pom.xml文件,所以需要在右侧的Maven栏目中点击 + 号,选中项目的pom.xml文件,则导入成功.
- SpringBoot源码分析之---SpringBoot项目启动类SpringApplication浅析
源码版本说明 本文源码采用版本为SpringBoot 2.1.0BUILD,对应的SpringFramework 5.1.0.RC1 注意:本文只是从整体上梳理流程,不做具体深入分析 SpringBo ...
随机推荐
- Apache Druid架构原理与应用场景
为了帮助卖家提高运营水平,卖家管理后台会展示一些访客.订单等趋势和指标数据,如PV,UV,转化率,GMV等: 这些指标的计算依靠前端埋点和订单详情等数据,其特点是数据量大,并有一定的实时性要求. Dr ...
- MongoDB慢查询性能分析
最近,长期运营后的港台服出现一个问题,web充值很慢,用gm指令查询玩家信息也很慢.最后定位到MongoDB查询也很慢. 刚开始定位的时候,运营SA直接查指定的玩家,并反映很慢,就猜测是索引的问题 ...
- 安装网卡ifconfig不出现问题
安装万兆网卡,Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection 使用lspci ...
- excel 用VBA将所有单元格内容全部转换为文本
Sub 将所有列全部转换为文本() t=timer 'Cells(Rows.Count, 1).End(xlUp).Row 获取第一列最后一个非空单元格的行号 s = Cells(, Columns. ...
- 右键菜单添加包含ICON图片的快捷打开方式
右键菜单添加包含ICON图片的快捷打开方式: ①保存如下代码为“submit.reg”, ②修改对应的程序地址 ③双击创建的文件,导入到注册表中,即可 Windows Registry Editor ...
- Win10激活密钥key(可激活所有版本)
Win10激活密钥key(可激活所有版本) Win10一年的免费升级服务已经到期,用户要使用Win10系统,就需要最新Win10密钥来激活Win10,一般激活Win10系统有两种方式,一个是使用Win ...
- js 实现仿 淘宝 五星评价 demo
<style> @font-face { font-family: 'iconfont'; /* project id 247957 */ src: url('//at.alicdn.co ...
- Centos6.5下使用LAMP搭建discuz论坛(编译安装 PS :自学中 写的不好请见谅)
wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.2.27.tar.gz 下载Apache软件包 wget http://downloads.my ...
- 2018.8.8 SpringMVC分层
分层: 表示层:请求分发,调用处理器,页面展示. 业务层:业务处理接口和实现. 持久层:数据访问和持久化. 各层之间解耦,下层对上层透明. 具体代码分析如下图,图转自https://blog.csdn ...
- P2568 莫比乌斯反演+整除分块
#include<bits/stdc++.h> #define LL long long using namespace std; ; bool vis[maxn]; int prime[ ...