简体   繁体   中英

How to deploy spring boot application into it self

I have a spring boot application that running on embedded tomcat with java -jar app.jar on a server away from my work office, and I haven't any ssh or other access to that server. So when I want to install and run newer version of application, I should go to the server place, physically connect to server and then install and run newer version.

Is there a way to run newer version of application without going to the server place? for example, upload newer jar file into my running application, and itself update it.

NOTE

I don't have any access to server and cannot use and run any continous delivery tools like jenkins or other, because of IP and port restrictions.

I did something like this a while back which worked out pretty well.

So you could create a super small app on the server(so small that it "never" needs to be updated) and have that monitor the versions and when a new version is available it could stop the real process and restart it with the new jar file.

I unfortunately don't have the code for that starter app, but it shouldn't take that long to write one that suits your needs

Why don't you install a Tomcat to the server and use it's management GUI to deploy the newer version of the app? It is a very old fashion but works well. The only thing you will need to modify in your source code is to replace the packaging from jar to war in the pom.xml, so you can deploy it via Tomcat Manager. This how the manager GUI looks like: 在此处输入图片说明

You can learn more about the Tomcat Manager here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM