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
shell 命令 启动常用 微服务
最新推荐文章于 2024-05-27 10:39:50 发布