What is the best way to launch Jenkins Server - linux

What is the best way to launch jenkins server in linux ?
Is it through deploying .war file in tomcat or through jenkins installation

It really depends how much traffic and number of builds.
I launch mine with tomcat 8 and nginx as the webserver. I used this as my guide.
I launch it via cron because on a daily basis I restart the tomcat instance.

I have used both ways to launch Jenkins server but I prefer to deploy Jenkins war file inside any web container.
It helps me to manage and upgrade Jenkins very easily.

Related

scripting in jenkins for deployment

I have my jenkins installed on windows server, configured with git.
Currently using deploy to container plugin to deploy build to remote hosts. now instead of deploying using plugin, i want to write a shell script which will deploy war in post build action. my remote machine is linux machine (Centos).
gone through link
Run batch scripts on a remote server (windows) from jenkins
but not a great help.
any help will be appreciated.
Thanks

Jenkins deployment to windows

I want to automate deployment of my project from Jenkins on a Linux server to a Windows server. As I have read, there are some tools to scp from linux to windows. Is there a tool that I can use to push the build from linux using a script?
One solution should be to install a Jenkins slave agent on the Windows machine.
With this solution, you can create a dedicated job and launch it on the Windows node.
This job can get the artefact (or the build result) from the Linux server with the Copy Artifact plugin.

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.

how to configure Jenkins on Unix and deployment in a remote machine windows

I have an issue about Jenkins.I used a freestyle project not a maven project because it's a nodeJS project.
The Workflow is as below :
Jenkins trigger from GitLab Acceptation Merge Event.
Jenkins execute the build for testing integration.
execute shell command (linux) in actual linux OS.
Jenkins deploy the project after test success to a remote Windows Machine.
So what i want is how to deploy to a remote windows machine
Jenkins and Git are in the same machine (linux).
and deployment in a remote machine Windows.
You can plan to use a deployment automation solution like Xebialabs XL Deploy/IBM udeploy/CA Nolio as they are specialised products that will take care of a lot of the use cases related to deployment out of box and you do not have to create a scripted solution in Jenkins.
you can use gitDeploy framework, that always does the job
AFAIK, you can not deploy to a windows remote machine only using Jenkins. There is a Jenkins plugin https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+CIFS+Plugin which might be worth looking, but I doubt if it will solve all the requirements. As it is for copying files to WINS share.
I would suggest you to have a look at Ansible (http://docs.ansible.com/ansible/intro_windows.html), you can install the ansible controller on the Linux along with Git & Jenkins and configure jenkins to trigger the ansible deploy on to the target windows machine.

Getting Tomcat to play well with Netbeans 6.7 on Linux

I have an external Tomcat server configured to run J2EE applications on my development (Gentoo Linux install) machine. This works great if the server is started prior to opening Netbeans and deploying the code [within the IDE]. This fails when I try to restart the server or to debug the server application. The error I get is that it is unable to find "catalina.sh" and the shutdown/start scripts for tomcat.
The Gentoo guide for this suggests that the scripts were outdated and were replaced with the init.d scripts. Does anyone have a suggestion on where I could find these scripts or how they solved this issue?
The lack of a script is due to an issue with the Gentoo Tomcat ebuild... all of the script files were in the bin directory of the src build.
Gentoo Bug Site
Solution:
1. un-tar the src
Copy all of the script files into the tomcat/bin directory
Change group ownership of the script files to tomcat
Enable execute and write group permissions to the script files

Resources