I have Jenkins set up with nginx in a docker container on a droplet. I installed the plugin Deploy to Container on Jenkins. Now I need to set up a Tomcat server to deploy the Jenkins war file to.
So where does my Tomcat server go? And why do I need another server when I have a droplet already? Do I need a new docker container on my droplet for the tomcat server?
My Jenkinsfile deploy stage currently looks like this, but I need to context?
stage('Deploy') {
steps {
echo 'Deploying...'
sh 'deploy contextPath: null, war: "/usr/share/jenkins/jenkins.war"'
}
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
It would not be a problem to run your Tomcat server on your existing Droplet. You can take a look at this tutorial here on how to install Tomcat on your Droplet:
https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04
Regarding the Pipeline itself, it would really depend on what setup you would like to have at the end, for example, if you like Jenkins to build your Java project and then containerize it and deploy it on the same server? If this is the case you could have a similar setup to this one:
https://www.digitalocean.com/community/questions/running-jenkins-in-docker
That way your Jenkins container would have access to the Docker service on your host, and you can spin up containers from inside Jenkins and start them on your Droplet directly.
If you prefer not to run your app in a container, you could take another approach and share a volume between your Jenkins container and your Droplet, then with the copy command that you already have, you could copy the war file from your Jenkins container to the share volume so that the war file would be available on your Droplet where you could have your Tomcat running.
Regards, bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.