Unable to locate Jenkins file when Jenkins is installed over Tomcat on Linux Machine - jenkins

Unable to locate Jenkins file when Jenkins is installed over Tomcat on Linux Machine
I have installed Jenkins(Jenkins.war) on a Linux (RedHat) machine using Tomcat application server.Prior to installation I had set my JENKINS_HOME(in ~/.bash_profile) to /apps/jenkins folder so that Tomcat will install Jenkins on this directory.
Post installation Jenkins is up and running and my jobs are executing fine.However, I need to change JENKINS_USER to other user but I am not able to locate the Jenkins file that will have info like JENKINS_USER and JENKINS_PORT.
I tried searching this file under following directories but no success.
/var/lib/jenkins
/etc/sysconfig
/etc/default
I am not able to find it even in the Jenkins installation directory.
Any help would be appreciated.
Thanks

The files you are searching are only found in the standalone installations of Jenkins through various package managers of different supported Linux distributions for which Jenkins offers packages.
The install of Jenkins in Tomcat is just downloading and copying jenkins.war in Tomcat's webapps folder as a servlet, everything else is managed through Tomcat config files, like setting JENKINS_HOME or changing the port by editing the connector xml for example.
The documentation on running Jenkins as a .war in Tomcat is here. You can see examples on how to change the connector port in $TOMCAT_HOME/conf/server.xml and also JENKINS_HOME in the context. I assume you understand at least how Tomcat works and how to configure it.

Related

Jenkins jar vs dockerfile

I started learning devops recently. Guys I have a doubt here please solve. After testing Jenkins package everything including code and dependencies into a war/jar file. Even dockerfile contains application's source code and dependencies. Now if we are using the docker container to deploy onto production server. Now where do we use the war file that is generated from JEnkins? someone please clarify.
So lets take Jenkins itself as an example. you can download jenkins.war but still you need a place to host this war file so you can use docker for that. think of it as an alternative for virtual machines.
So the jar file that you have generated through jenkins build needs java or tomcat or whatever external dependencies to be up and running docker can do that for you. Take a look at the following example:
Run a Simple .jar Application in a Docker Container

Update jenkins war on one machine and then move it to another one: possible?

I have a machine with blocked outgoing connections so it is not possible to update jenkins nor install the plugins I need for my work.
My idea is the following: I download the jenkins .war on my personal laptop and complete the installation + the plugin download.
Then I just move this .war to the machine where I need jenkins to be up and running.
Is it possible? Where are the plugins/updated data stored?
Also, would it be a problem the fact that my laptop has windows as os, while the destination machine is a linux RHEL?
Your solution sounds crazy :D
This could be help you:
Update Jenkins war
If you have shell access with root privilege, there is a manual way.
Download latest war file inside your linux, using wget , curl or just upload it using winscp from your windows.
Stop jenkins
Backup EVERYTHING: linux snapshot, jenkins workspace, jenkins war file, etc
Replace the old war with new war
Start jenkins
Detailed steps in this webs:
https://mohitgoyal.co/2017/02/15/upgrade-jenkins-server-to-a-new-version/
https://www.thegeekstuff.com/2016/06/upgrade-jenkins-and-plugins/
Plugin
Jenkins has an option to install plugins called Manage Plugins
This offer two options :
(1) Install plugins using available option
For official and compatible plugins, suggested by Jenkins :
(2) Install plugins using upload option
For custom plugins or when is not available on official repositories:

Jenkins on Linux - Logs

I have a Jenkins installation in a Linux VM. I'm looking for the file jenkins.wrapper.log to find out when the app was started/stopped. Unfortunately I can't find the file?
How else can I retrieve when Jenkins started/stopped?

How to install jenkins plugins in offline mode

I am sitting behind proxy. I can not bypass it as I am not allowed to download anything on this linux box. I don't have root privilege either.
I have deployed jenkins.war on apache tomcat. Also, downloaded all necessary Jenkins plugins and placed it as shown below:
jenkins
+apache-tomcat-8.5.12/webapps/jenkins
+apache-tomcat-8.5.12/webapps/jenkins.war
+plugins
Can anyone please let me know is there any way I can simply point to 'jenkins/plugins' directory path in some config file to install plugins.
Thanks
On the master
Assuming a .hpi file has been explicitly downloaded, the administrator can manually place the .hpi file in a specific location on the file system.
Copy the downloaded .hpi` file into the JENKINS_HOME/plugins directory on the Jenkins master (for example, on Debian systems JENKINS_HOME is generally /var/lib/jenkins).
The master will need to be restarted before the plugin is loaded and made available in the Jenkins environment.
pay attention for the dependencies plugins some plugins claim other plugins
Jenkins plugins
Finally resolved this issue. Copied all plugins # /home/appuser/.jenkins/plugins. When we deploy jenkins.war on apache tomcat it creates jenkins-home # /home/user/.jenkins

Upgrade to Jenkins 2.0 on Windows Server

We are currently running version 1.651.3 on our server and want to upgrade to version 2. From what I can tell online, I just need to run the .msi file and install into the current Jenkins directory and we're good. That didn't work, so I tried stopping the Jenkins service and installing again, but it is still running the old version. What am I missing?
So I didn't realize that you could just download the .war file instead of one of the deployment options. I was clicking Windows and getting the .msi instead of clicking 2.11 .war and getting the .war file. I then dropped this into the C:\Program Files (x86)\Jenkins directory on my server and all was good in the world.

Resources