# Deploy to Linux and Windows with tomcat

**URL:** <https://community.jenkins.io/t/deploy-to-linux-and-windows-with-tomcat/10039>\
**Category:** Ask a question\
**Created:** [October 6, 2023, 4:19pm UTC](https://community.jenkins.io/t/deploy-to-linux-and-windows-with-tomcat/10039 "2023-10-06T16:19:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [October 6, 2023, 4:38pm UTC](https://community.jenkins.io/t/deploy-to-linux-and-windows-with-tomcat/10039/2 "2023-10-06T16:38:58Z")

</div>

> [@Fernandoc4d](#):
>
> What I need is for Jenkins to check every x time if there are changes in the controller of a repository,

You’ll have a better experience if you configure your repository to notify Jenkins whenever there is a change. That is usually done with webhooks. In many cases, an organization folder or a multibranch Pipeline may configure those webhooks automatically. You want to avoid polling for changes. As advised by Kohsuke Kawaguchi in 2011, [“polling must die”](https://kohsuke.org/2011/12/01/polling-must-die-triggering-jenkins-builds-from-a-git-hook/).

> [@Fernandoc4d](#):
>
> if there are, to deploy that code to different machines, both Linux and Windows with tomcat (the part of all the stop instructions tomcat and copy the new .wars and start tomcat I would do it with Ansible)  
> What is the best option of all that Jenkins offers to do something like this?

If it were me, I’d create a command line script or program in my favorite scripting language. Once that command line script is working, I’d add a `Jenkinsfile` that calls the script. If the script needs credentials, have the Jenkinsfile pass them in using `withCredentials`.

I’d keep the Jenkinsfile as short and simple as possible because it is a lot easier to debug deployment failures from a development environment on my desktop than to repeatedly run the Jenkins job to debug failures.

---

_[View the full topic](https://community.jenkins.io/t/deploy-to-linux-and-windows-with-tomcat/10039)._
