当前位置: 首页 > news >正文

无锡网站建设公司百度指数查询手机版app

无锡网站建设公司,百度指数查询手机版app,网站建设126,怎样做网站 - 百度背景 远程部署时spring boot 包&#xff0c;比较大。可以采用依赖库和业务包分离的方式。提供一个脚本进行自动部署 maven 配置分离jar包 <build><finalName>${project.artifactId}</finalName><plugins><plugin><groupId>org.springfra…

背景

远程部署时spring boot 包,比较大。可以采用依赖库和业务包分离的方式。提供一个脚本进行自动部署

maven 配置分离jar包

 <build><finalName>${project.artifactId}</finalName><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>${spring-boot.version}</version><configuration><!-- 导入系统路径包 --><includeSystemScope>true</includeSystemScope><includes><include><groupId>nothing</groupId><artifactId>nothing</artifactId></include></includes></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jar-plugin</artifactId><configuration><archive><!-- 生成的jar中不要包含pom.xml和pom.properties这两个文件 --><addMavenDescriptor>false</addMavenDescriptor><manifest><addClasspath>true</addClasspath><classpathPrefix>lib/</classpathPrefix><!--这里需要修改为你的项目的主启动类--><mainClass>com.ruoyi.RuoYiApplication</mainClass></manifest></archive></configuration></plugin><!--设置将 lib 拷贝到应用 Jar 外面--><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-dependency-plugin</artifactId><executions><execution><id>copy-lib</id><phase>package</phase><goals><goal>copy-dependencies</goal></goals><configuration><outputDirectory>target/lib</outputDirectory><excludeTransitive>false</excludeTransitive><stripVersion>false</stripVersion><includeScope>runtime</includeScope></configuration></execution></executions></plugin></plugins></build>

部署脚本

#!/bin/bashAppName="smart_engineering_admin.jar"
RemoteUser="root"
RemoteHost="xxx.xxx.xxx.xxx"
JVM_OPTS=" -Dloader.path=smart_engineering/lib -Dserver.port=8080 -Dname=$AppName  -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps  -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"start() {echo "Starting $AppName on $RemoteHost"# 定义一个内嵌的函数来远程查询 PIDquery() {ssh "${RemoteUser}@${RemoteHost}" "ps -ef | grep java | grep '$AppName' | grep -v grep | awk '{print \$2}'"}# 获取远程进程 IDPID=$(query)if [ -n "$PID" ]; thenecho "$AppName is already running on $RemoteHost (pid: $PID)..."elseecho "Starting $AppName on $RemoteHost..."ssh "${RemoteUser}@${RemoteHost}" "nohup java $JVM_OPTS -jar smart_engineering/$AppName > /dev/null 2>&1 &"echo "$AppName started successfully on $RemoteHost."ssh "${RemoteUser}@${RemoteHost}" "tail -f logs/sys-console.log"fi
}sync() {rsync -avc --delete ruoyi-admin/target/lib/ root@140.143.209.33:smart_engineering/libscp ruoyi-admin/target/smart_engineering_admin.jar root@140.143.209.33:smart_engineering/
}stop() {echo "Stopping $AppName on $RemoteHost"# 定义一个内嵌的函数来远程查询 PIDquery() {ssh "${RemoteUser}@${RemoteHost}" "ps -ef | grep java | grep '$AppName' | grep -v grep | awk '{print \$2}'"}# 获取进程 IDPID=$(query)if [ -n "$PID" ]; thenecho "$AppName (pid:$PID) is running. Sending TERM signal..."ssh "${RemoteUser}@${RemoteHost}" "kill -TERM $PID"# 等待进程退出while [ -n "$PID" ]; dosleep 1PID=$(query)doneecho "$AppName has exited."elseecho "$AppName is already stopped."fi
}sync
stop
sleep 2
start
  • 优点
    • 依赖包不变化不会同步,减少上传的文件
    • 每次都同步业务包,保证准确性
    • 提升发布速度

要求

  • windows 的wsl下可用
  • 需要和服务器配置ssh互信

进一步封装

#!/bin/bash./mvnw -T 1C clean package -P prod./push_run.sh
http://www.hyszgw.com/news/18934.html

相关文章:

  • 日照园林建设发展有限公司网站合肥seo软件
  • 医疗教育的网站建设网站开发的基本流程
  • 版面设计网站有哪些培训心得体会范文
  • 手机网站制作流程外贸网站设计
  • 卡盟网站模板怎么接广告推广
  • 环境设计案例网站站长工具seo综合查询怎么关闭
  • 网站开发是做什么的长沙网址seo
  • 网站制作维护南昌seo营销
  • 帝国怎么做网站品牌传播策略
  • 深圳建站公司哪个济南兴田德润简介广州 竞价托管
  • 家具企业网站模板产品推广方法有哪些
  • 做暧暖ox免费视频网站网络营销措施有哪些
  • 江西万年县建设局网站个人网站制作模板主页
  • ps快速做网站凌哥seo
  • wordpress codeboxseo是什么岗位简称
  • wordpress 营销插件seo有些什么关键词
  • 17网一起做网站产品怎样推广有效
  • 如何注册成立家族公司seo优化排名价格
  • 河北省政府网站建设现状东莞今日头条最新消息
  • 公司用dw做网站吗灰色词优化培训
  • 著名的深圳网站建设免费的网站域名查询
  • 做酒店网站所用到的算法网站怎么做到秒收录
  • 什么类型的网站容易被百度抓取收录网站
  • 手机网站转换小程序会计培训
  • java 做直播网站自建站模板
  • 网站后期维护费用怎样版费百度平台商家我的订单查询
  • 网站改版阿里云怎么做网站301定向百度 指数
  • 湛江网站制作系统品牌推广与传播
  • google浏览器官方下载杭州上城区抖音seo有多好
  • 爱做奈官方网站腾讯广告推广怎么做