I am not able to set Git path in Jenkins - jenkins

I have installed Git on my CentOS 7 and installed Jenkins
When I give my Git Path in the Source code management section, I am getting the below error. Can someone please error
I have already googled and tried many commands ( I am pretty new to Linux commands) but didn't help
Please help me

It seems like Jenkins is unable to execute the script because it does not have adequate permissions for the temporary directory.
Give the user running Jenkins access to read and write to /tmp.

Looks like error is in Repository URL.
Take url from your repo like in the picture and paste to jenkins job config.

Related

Re connect SonarQube with Jenkins

I have the next problem. We have the lastest LTS versions from Sonarqube and Jenkins. Both are connect and run without problem.
Now we want to change Sonarqube host. For example:
Before:
http://our-url:9000/sonar
Now:
http://our-url:9000
We clone the server to test if all works fine or not. Change URL from Sonarqube inside Jenkins and run a test project and everything is fine but when we wanna see the existing projects they are not linked to Sonarqube. Thats the problem.
Somebody knows how re connect that project again? Without run another test? Well, if it's possible.
Thanks.
I suggest you to create a webhook on sonar-side:
https://<your Jenkins instance>/sonarqube-webhook/
If you use pipeline you can find useful info at: https://blog.sonarsource.com/breaking-the-sonarqube-analysis-with-jenkins-pipelines/
If someone have this weird and unusual problem, you can solved it if you go to Jenkins folder > Jobs > Your Job > build > # of the builds (need to edit all) > Edit the text file. Then search the sonarqube URL and edit it.
Cheers!!

What does jenkins look into the project to start unit tests

I have looked into jenkins tutorials and all most all of them mention that we should provide with the URL to the git repo.
Fine.
But once jenkins has an access to the git repo, what part of project does it look into to figure out which tests should be run or wether to run them at all etc ? Is it some configuration file in the repo ?
Guess that depends on what kind of project your repo is. If I understand the question correctly. The provided url gives Jenkins the information to do a git clone url which checks out the project in Jenkins workspace.
Then according to the type, lets say it's a Maven-project, you fill in the goals you'd like Jenkins to run locally. Usually clean test. It is then run at top level, root of the project, guessing it will find a pom.xml there. If not you'll have to tell it where to look.
A more clearer answer would perhaps be easier if you told what kind of project you'd like to build.

Jenkins Update Loses Old Jobs

I am on a redhat linux box. I recently updated Jenkins to version 1.509 only to find that after doing so it has "forgotten" two of my jobs/projects. The jobs can still be found on my Jenkins machine under /var/lib/jenkins/jobs, but they no longer show up in the Jenkins GUI. I attempted to re-create them based off the configuration file I have, but I am not confident I have totally re-created the functionality they had.
I also tried to copy the job and or rename it hoping that would get jenkins to see it, but no luck. I had tried cp -r /var/lib/jenkins/jobs/JOB1 /var/lib/jenkins/jobs/JOB2. I also restarted the service a number of times. Finally I updated all of my plugins on the off chance that was somehow related.
So my question is "How can I get Jenkins to notice these jobs?" or failing that "can I run these jobs from in the terminal?"
NOTE: I am not discouraging others from upgrading Jenkins. After I upgraded Jenkins did complain about a number of things which I didn't pay enough attention to which I believe got me into this mess in the first place.
If I were you, I would try the Jenkins CLI (from $JENKINS_URL/cli) and use the create-job command and feed the job configuration file to the cli's stdin.
If that does not help, I would inspect Jenkins log files (you are saving stdout and stderr of Jenkins somewhere, right?) for any errors or clues. If the job failed to load because of some tag that you can guess is provided by a plugin, try to remove that part from the config file.
If that does not help, I would upgrade Jenkins. I think there might be some fixes related to this in the LTS version changelog since 1.509.
And above all... if I were you, I would start making backups of the job configuration files.
I regularly back up the global config.xml, all the job config.xml files and all the plugins. Using these I can set up my Jenkins from scratch. And I do that to set up a test instance where I try any plugin or Jenkins core upgrade. If I see no problems after running a few of the trickiest builds, I know I can upgrade the production instance with much more confidence.

Jenkins not able to use SVN credentials or download new plugins/new versions

Can anyone suggest how to fix the two issues?
- Can't upgrade Jenkins and SVN plugin
- Can't connect to svn
I am setting up Jenkins on a Windows 64 bit machine. It's configured to run as a windows service.
We are running this on Windows 7 64 bit OS
Jenkins 1.482
I am able to do an SVN update/checkout from my user account on the machine.
When I attempt to set up a job on jenkins I get the following when trying to add svn credentials
FAILED: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS /svn/client/trunk failed
More details are:
FAILED: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS /svn/client/trunk failed
org.tmatesoft.svn.core.SVNException: svn: OPTIONS /svn/client/trunk failed
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:298)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:283)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:271)
at ...
I stopped the service and ran Jenkins from command line and tried the same thing - with the same result.
I am able to connect to the svn server with a tortoise client and via firefox with the same credentials.
In researching the issue I saw a few posts about similar problems and the only one that seems to claim to fix it is rolling back to Jenkins svn plugin version.
I then tried to install the latest jenkins and Plugin for svn. The downloads failed. Aha, I thought - obviously a firewall issue. So I disable the firewall.
Still no good. I can't automatically download or get the new Jenkins or SVN plugin.
Try starting jenkins with this option:
-Dsvnkit.http.sslProtocols="SSLv3"
Or, if Jenkins is starting svn plugin in a separate JVM, try adding the line to wherever the svn plugin run configuration is.
It's a known problem with svnkit, which is used by Jenkins' svn plugin:
http://issues.tmatesoft.com/issue/SVNKIT-176
Also, this answer can be helpful with regards to upgrading your svn plugin.
To change your Windows service commandline:
open a command line window cmd.exe
sc qc "JenkinsSlave" (if that's what your service name is)
select and copy the BINARY_PATH_NAME value
change it, adding -Dsvnkit.http.sslProtocols=""SSLv3"" after the jar path - mind the double quote
sc config "JenkinsSlave" binPath= <paste the changed value copied earlier>
Replace JenkinsSlave with your service name.
Windows 7 x64 has some automatic firewall settings. You may need to open a firewall port to allow the connection.
You should be able to verify or eliminate this as a cause by trying to run your svn client outside Jenkins.
bit late topic, but did you try the following solution?
http://www.daangemist.nl/2014/03/03/jenkins-reports-sslv3-error-on-svn-update
that one worked out for me, in my case I wanted to use -Dsvnkit.http.sslProtocols="TLSv1"
What about running Jenkins service with your account?

Where is the Jenkins working directory located?

Situation:
I installed Jenkins on my vserver and setup a "freestyle pipeline". I connected it via webhook push to my github which works (when I push to the repository, a new build job is started in jenkins).
Problem:
I can't seem to find the working directory where the git pull is executed in. I already searched for answers and many people say $JENKINS_HOME, but echo $JENKINS_HOMEreturns a blank line for me. Did I do anything wrong or where is my project then? Also, can I set the path to where the repository is pulled to a custom path (say /root/myprojectname)?
EDIT:
I can see the workspace in Jenkins webuserinterface but I can't find the corresponding folder on the vservers drive.
Did you check in /var/lib/jenkins. By default the jenkins home directory lies there as well in case of linux servers. It should also show you the home directory by browsing Manage Jenkins--> Configure System

Resources