shell 命令 启动常用 微服务

echo start shell.sh
id=$1
port=$2
profile=$3
if [[ ${id} == eureka || ${id} == gateway || ${id} == config || ${id} == dashboard ]]; then
  app=${id}-0.0.1-SNAPSHOT.jar
else
  app=${id}-service-0.0.1-SNAPSHOT.jar
fi
if [[ ! -n ${profile} ]]; then
  profile=test
fi
current=`date +%Y%m%d%H%M%S`
shell=shell.sh
dir=/testprojecg/test_app/deploy/deploy/api-component
mkdir ${dir}/${current}
cp ${dir}/upload/${app} ${dir}/${current}/
if [[ $? -ne 0 ]]; then
  exit 0
fi
#rm ${dir}/upload/${app}
pid=$(ps aux | grep ${app} | grep -v grep | grep -v ${shell} | awk '{print $2}')
if [[ ${pid} ]]; then
  kill -9 ${pid}
fi
java -version
if [[ ${id} == eureka || ${id} == gateway  || ${id} == gateway2 || ${id} == config || ${id} == dashboard ]]; then
  java -Xms512m -Xmx2048m -jar ${dir}/${current}/${app} --server.port=${port} --spring.profiles.active=${profile} &
elif [[ ${id} == api-rfc ]]; then
  if [[ ${profile} == production ]]; then
    java -Xms512m -Xmx2048m -Xbootclasspath/a:/testprojecg/test_app/lib_rfc/sapjco3.jar -Dloader.path=.,/testprojecg/test_app/lib_oracle,/testprojecg/test_app/lib -jar ${dir}/${current}/${app} --Dspring.config.location=/testprojecg/test_app/config/${id}.yml --server.port=${port} --spring.profiles.active=${profile} &
  else
    java -Xms512m -Xmx512m -Xbootclasspath/a:/testprojecg/test_app/lib_rfc/sapjco3.jar -Dloader.path=.,/testprojecg/test_app/lib_oracle,/testprojecg/test_app/lib -jar ${dir}/${current}/${app} --server.port=${port} --spring.profiles.active=${profile} &
  fi
elif [[ ${id} == api-bpm ]]; then
  if [[ ${profile} == production ]]; then
    java -Xms512m -Xmx2048m -Dloader.path=.,/testprojecg/test_app/lib_oracle,/testprojecg/test_app/lib_bpm -jar ${dir}/${current}/${app} --Dspring.config.location=/testprojecg/test_app/config/${id}.yml --server.port=${port} --spring.profiles.active=${profile} &
  else
    java -Xms512m -Xmx512m -Dloader.path=.,/testprojecg/test_app/lib_oracle,/testprojecg/test_app/lib_bpm -jar ${dir}/${current}/${app} --server.port=${port} --spring.profiles.active=${profile} &
  fi
elif [[ ${id} == api-quartz ]]; then
  if [[ ${profile} == production ]]; then
    java -Xms512m -Xmx2048m -Dloader.path=.,/testprojecg/test_app/lib_oracle,/testprojecg/test_app/lib_quartz -jar ${dir}/${current}/${app} --Dspring.config.location=/testprojecg/test_app/config/${id}.yml --server.port=${port} --spring.profiles.active=${profile} &
  else
    java -Xms512m -Xmx512m -Dloader.path=.,/testprojecg/test_app/lib_oracle,/testprojecg/test_app/lib_quartz -jar ${dir}/${current}/${app} --server.port=${port} --spring.profiles.active=${profile} &
  fi
else
  if [[ ${profile} == production ]]; then
    java -Xms512m -Xmx2048m -Dloader.path=.,/testprojecg/test_app/lib_oracle,/testprojecg/test_app/lib -jar ${dir}/${current}/${app} --Dspring.config.location=/testprojecg/test_app/config/${id}.yml --server.port=${port} --spring.profiles.active=${profile} &
  else
    java -Xms512m -Xmx512m -Dloader.path=.,/testprojecg/test_app/lib_oracle,/testprojecg/test_app/lib -jar ${dir}/${current}/${app} --server.port=${port} --spring.profiles.active=${profile} &
  fi
fi
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

杨航 AI

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值