简体   繁体   English

Teamcity-在构建和部署后如何在服务器上运行spring boot jar?

[英]Teamcity - How to run spring boot jar on server after Build and Deploy?

I have a Rest API based on Spring boot, embedded with jetty. 我有一个基于Spring boot的Rest API,嵌入了码头。 Normally I start it with java -Dloader.path=blablabla -jar blablabla.jar . 通常我以java -Dloader.path=blablabla -jar blablabla.jar I've configured a teamcity Build step to look for new check-ins to the git repo, pull and build (maven) the project, generate artifacts.. 我已经配置了teamcity Build步骤,以寻找新的git repo签入,拉出并构建(Maven)项目,生成工件。

Further, I've added a Deploy step which has dependency on Build step (successful completion and artifact dependency).. Here, I use powershell to push the artifacts to the server on which i want the rest service to run. 此外,我添加了一个Deploy步骤,该步骤依赖于Build步骤(成功完成和工件依赖)。在这里,我使用powershell将工件推送到要运行其余服务的服务器上。

A few questions: 几个问题:

1) Powershell - Is it the right way to publish files to the server from teamcity? 1)Powershell-是从te​​amcity将文件发布到服务器的正确方法吗?

2) How do i get the teamcity to actually start my spring boot app? 2)我如何获得团队协作才能真正启动我的Spring Boot应用程序? Some sort of a remote command execution? 某种远程命令执行?

Note: Both teamcity server and the app server are Windows. 注意:teamcity服务器和应用程序服务器均为Windows。

Solved it myself: 我自己解决了这个问题:

1) Yes, powershell does the trick pretty neatly. 1)是的,powershell巧妙地完成了这个技巧。

2) Got it to work with a combination of [WMICLASS] 's create() and Start-Process . 2)使它与[WMICLASS] 's create()Start-Process Check my answer here . 在这里检查我的答案。

Cheers! 干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Teamcity构建和部署后运行Spring Boot应用程序 - Running spring boot app after teamcity build and deploy 具有jar依赖项的Spring Boot应用程序在Maven构建后无法运行 - Spring Boot application with a jar dependency does not run after maven build 构建 jar 并运行 spring 从 cmd 启动 - Build jar and run spring boot from cmd 如何在Heroku中部署Spring Boot应用程序jar - How to deploy spring boot application jar in heroku 构建后如何从TeamCity将Java .war文件部署到Linux服务器? - How to deploy java .war file to Linux server from TeamCity after build? 从Spring Boot应用程序导出jar并部署到ubuntu服务器 - exporting jar from spring boot app and deploy to ubuntu server 如何从Spring Boot jar构建DockerImage - How to build DockerImage from Spring Boot jar Spring Boot + Gradle:如何构建可执行jar - Spring Boot + Gradle: how to build executable jar 如何将简单的Spring Boot(使用Gradle构建系统)部署到Apache Tomcat(真实服务器,而不是嵌入式服务器)? - How to deploy a simple Spring Boot (with Gradle build system) to Apache Tomcat (real server, not embed server)? Spring Boot Maven plugin - How do I build a zip file with Java jar file and script to run it? - Spring Boot Maven plugin - How do I build a zip file with Java jar file and script to run it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM