简体   繁体   中英

Jenkins deployment from linux server to windows server

In company i have 3 servers, 2 linux servers and 1 windows server. I build .war on Linux server and i want to deploy it on second linux and windows server, for linux i use deploy plugin and it doesn't support version of tomcat8, and also it doesn't have option deploy war on windows server.

So my idea is to deploy war to samba directory then use copy script to obtain .war file. For windows i can use samba folder and in tomcat configuration use a deploy Application from a Local Path. Is there some more gentle solution of this problem ? If there some risk from using that solution ?

Edit: In case when I try to use mounted directory, i use docBase="//ip/directory" and path="directory" i obtain error with The main resource set specified [\\ip\\directory] is not valid. I'm curious is even possible to do this ?

So if someone will face the same problem that is the solution:

On Jenkins server install plugin to execute shell scripts. That allow us to run cURL command. To deploy .war on Windows server use command with cURL, example:

curl -T /var/lib/jenkins/jobs/(Path to war ) http://user:password@ip:port/manager/text/deploy?path=/(nameOfWar)&update=true

Also add role manager-script to your Tomcat user.

For deploy on Linux servers I use plugin Deploy war/ear to a container. So it's all in Jenkins and Tomcat.

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