Jenkins on Linux - Logs - jenkins

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?

Related

How to attach build log files to Jenkins?

I'm building Jenkins pipeline and after pipeline fails with server installation some logs are generated on machine where server is being installed.
I want to attach those logs to Jenkins build so person can see that file from Jenkins build only instead of going to machine and find it out.
I saw a plugin Copy To Slave Plugin but for installation when I searched for it in Jenkins, it's not listed.
Could you please suggest which plugin will help me to attach log files to Jenkins build?
Due to the complex nature of filesystems, Jenkins is not capable to copy logs from extraneous locations like those outside of the Jenkins root directory. This is for security reasons, which is why the Copy to Slave Plugin you referred to earlier has been discontinued.
In short, Jenkins spawns processes that spawn other processes that are owned by different users in the filesystem (e.g. root). For this reason, it is highly probable that the log files you are referring to are located elsewhere on the file system (i.e. not in $JENKINS_HOME), and thus are not owned by the jenkins user.
It is possible to use cat or tail on the log files in the Jenkins build itself. In combination with a plugin like Log Parser, this can provide some nice output in another screen.
I would be interested about what do you mean by “install”? Can the install happen during the building of a Docker image? Or in a pre-built Docker container? If this is the case, you can copy the “installed” files to the destination.
This would help you, because any log files created during the “install” can be copied out from the docker container and attached to the Jenkins build as an archived artifact.
For this, you don’t even need a plug-in.

Getting Permission Denied to C Drive in GoCD ANt Task. I have installed gocd server on windows 10

I have installed GoCD server on windows10 machine. Created a pipeline which contains ANT job.
In the second run it is not able to delete content from C drive from windows machine.
Giving error: Permission Denied

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

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.

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:

How to make the Jenkins build output as downloadable from Jenkins server machine itself?

I am new to Jenkins. i have configured the Jenkins "Free Style" project and executing a power shell a script to get an executable application(Exe) as output. i have searched for some of the plugins to make the Jenkins output (exe) as downloadable from the Jenkins server machine itself as an artifact link(download link). But i found the Jenkins plugins to copy the archive files, upload to ftp and some other plugins.
So, Could anyone please suggest me is there any option or plugin available to make the each Jenkins build output file as downloadable from the Jenkins server machine by keeping it in a server machine some other place?
A simple option would be to copy the artifact to the userContent directory in Jenkins. This is found under $JENKINS_HOME.
Once artifact is there, you can have a static link to it in the form of
http://<jenkins-host>:<port>/userContent/<your-artifact.exe>
I hope this helps.

Resources