Jenkins : Invalid gitTool selection Git - ios

i've setup my own jenkins buildserver today on my windows PC to build commits to my bitbucket.org-repository automatically.
Sadly i'm deep in trouble with the conenction between jenkins and git.
This is my Jenkis-Git configuration:
This is the Jobconfiguration:
If i now run "Build now" i'm getting the following output in console:
I hope somebody here is abled to help me with this problem. The Job is building... and building... and building... no result.
Kind regards,
Daniel

I get these Git-related warnings as well, but Jenkins is working just fine for me. I believe that they can be ignored. There is an open issue about this.

confirm you do indeed have Git installed on your system. try again.
If still having issue, you may need to also add the path of the Git executable to your Node configuration. By going to your Node configuration page, 'Node Properties' section, 'Tools Locations' setting. There you will find an option to explicitly add the path to Git.

Related

Jenkins Email-ext plugin is no longer visible in the project's post build options

Does any one have any idea what could have happened to Jenkins Email-ext? We have had this plugin working just fine for over two years and all of sudden our entire configs for this plugin have disappeared from all of our projects. We tried to uninstall and re-install the plugin but that didn't make any difference.
Once you install this plugin there should be a checkbox under "Post-build Actions" section in the projects config page to enable it but this option is not shown any longer here. Any idea?
Thanks!
This issue was fixed by following the below steps:
Uninstall email-ext plugin from Jenkins
Stop Jenkins services. (Run > Services.msc) find Jenkins and stop it
Go to Jenkins home (base folder) > Plugins and remove any instances of email-ext plugin (e.g. C:\Program Files (x86)\Jenkins\plugins)
Restart Jenkins
Install email-ext plugin again
And now everything should be working OK again!
if you haven't upgraded your jenkins then the issue might be a different one , just to make sure email configuration section has completely removed from your job , check the config.xml of your jenkins job for the keyword [email-ext].
how to check job's config.xml from GUI ?
simple click on configure link of your job you will be redirected to something like below
http://yourserver/job/jobname/configure
now change the last part of url [configure to config.xml] resulting in something like below
http://yourserver/job/jobname/config.xml
now search for keywords like email and email-ext , if you did not find anything then email-ext plugin is not functioning or its has completely removed the email configuration from your job , if you find an entry , do a uninstall /install and then try a restart of jenkins might resolve your problem , or else you can try the option of reloading configuration from disk.

ANY WAY to RUn Debug/ Verbose Mode IN Jenkins, for .HPI plugin

I am having an issue with .HPI(jenkins Plugin) and so far no one is able to help me.
JENKINS .HPI dependencies issue << click on this link
so now i am wondering , is there a way that,
When using my .HPI(jenkins Plugin) in jenkins, I can run it in a debug or verbose mode, so i can see on the Console Output(in jenkins) what is exactly that is going on.
I think i am getting an error cause it is not going to the right .jar ....
when i ran it in eclipse I have no issue. ( i know which jar it is going to in debug mode in eclipse)
if you cannot run the .HPI(jenkins Plugin) in a verbose or debug mode in jenkins , maybe i can run it as a .WAR ? in a verbose or debug mode in jenkins ?
since i have read that .HPI is very similar to a .WAR.
so that way i can see in the output console exactly what .jar it is going to.
If someone can help me or point me in a direction it will be really helpful.
Try a debug from Eclipse! If it's not working, just add some logs to your project and when you run it in Jenkins, take a look at the logs in console ( easy if you start Jenkins from command line). Or, in the Jenkins installation folder there should be some log files.
Next time can you put the question more clear? It's somehow hard to understand what you ask.
Yes, I read your questions. I'm not sure if you'll can see which jar/ lib is chose by Jenkins.
But, about the link,previous question, I had a problem somehow like you with some libraries and tests, when I worked as plugin developer. I'm not sure if I remember correctly, but, just try, create a folder in your project, let's say libs, put the jars in that folder and add the folder to build-path in eclipse and maven should take care of them.
Not sure if it'll work, but you should try. Sorry I can't help you more!

Jenkins: how can I clean the workspace except the vagrant directory?

I have the following setup:
I use the workspace cleanup plugin in Jenkins to clean my workspace before each build. During my build-process I also trigger a vagrant up to setup a VM for phpunit tests:
$ vagrant up
$ ./runtest.sh
$ vagrant suspend
Now when I re-build the project, the VM gets build as a new one instead of just resuming the previous one. I guess this is because of the cleanup plugin removing the .vagrant-directory, therefore making Vagrant think it should build a new machine instead of just resuming the previous one.
Now I have configured the plugin to exclude the following patterns and I have the 'Apply pattern also on directories'-checkbox also checked:
**/*.vagrant
.vagrant
.vagrant/
./.vagrant
./.vagrant/
But still the .vagrant-directory gets deleted from the workspace on each new build, spawning a brand new VM each time...
Does anyone know how I can exclude the .vagrant-directory from the workspace cleanup plugin?
Turned out I was having a logical error. What I did as first task was checkout and hard-reset a specific branch to the master. So it was this step that actually deleted the .vagrant-directory after the cleanup-task did what it was expected to do.
According to the plugin documentation, it provides include and exclude patterns. You need to change the dropdown to exclude pattern (marked with arrow #2 in the diagram on plugin page), and type .vagrant in the pattern. Should probably also click "apply to directories"

Why does Jenkins change my gradlew, and how to prevent that?

I'm trying to 'release' my project using the gradle release-plugin
The plugin starts by checking if my working copy is clean, so that only properly versioned stuff gets released.
This works just fine on my local machine. But when I try the same thing in a Jenkins job, the build fails complaining various stuff is changed in the workplace. I decided that a lot of stuff was just internally used by jenkins and added it to gitignore:
caches/
native/
wrapper/
But it also considers gradlew as changed:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':checkCommitNeeded'.
> You have uncommitted files:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
M gradlew
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Why does Jenkins change that file how do I prevent that?
I think the following settings on the Jenkins job might be relevant:
Checkout/merge to local branch (optional) is set to master. Without this setting the release plugin complains about not being on a branch
Clean after checkout is currently checked, but checking/unchecking it didn't make a difference
Make gradlew executable is checked, and at least to me sounds like a likely cause, but unchecking it makes the build faile because gradlew is not executable
Pretty old question, but for the record to anyone coming over here, jenkins isn't at fault here, you should commit gradlew with executable bit set:
# git update-index --chmod=+x gradlew
# git commit
Then you will no longer need the jenkins setting to set it executable, which is the workaround causing your issue.

stderr: fatal: Couldn't find remote ref $GERRIT_REFSPEC

Before anyone guns me down..I have looked at all the messages that has this error but they seem to manifest from a different problem,I couldn't get any substantial information. Following are the errors I'm running into in the git polling log...
I don't have a clue regarding error #1,please provide inputs
For this,I read on other questions that $GERRIT_REFSPEC gets filled in dynamically when there is a gerrit trigger but i don't understand why I keep seeing this in the git poll log. How can I fix this ?
Error messages:
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
hudson.plugins.git.GitException: Command "/usr/bin/git fetch -t ssh://company.com:29418/platform/vendor/proprietary/mla.git $GERRIT_REFSPEC" returned status code 128:
stdout:
stderr: fatal: Couldn't find remote ref $GERRIT_REFSPEC
Go to the Job's Configure page and search to check This build is parameterized box.
Then set Name to GERRIT_REFSPEC
and Default value to refs/heads/master.
It took me some time to search for how to add this string parameter mentioned in the Gerrit Trigger plugin manual. I use Jenkins 1.567 with Gerrit Trigger 2.11.1.
As of May 2016, this error may be result of fix for SECURITY-170 introduced in Jenkins 2.3 or 1.651.2.
From wiki:
In a May 2016 security advisory, a vulnerability was announced (SECURITY-170 / CVE-2016-3721) whereby attackers could potentially exploit the fact that certain Jenkins plugins allow the definition of arbitrary build parameters — which are in turn injected into the build envirionment.
The fix for this issue — which was first included in Jenkins versions 1.651.2 and Jenkins 2.3 — means that only build parameters that have been explicitly defined in a job's configuration will be available by default at build time. Any other arbitrary parameters added to a build by plugins will not be available by default.
As there are a number of plugins that rely on the behaviour in older Jenkins versions, upgrading to 1.651.2 or 2.3 means that certain build behaviours may be broken.
One of the affected plugins is the Gerrit Trigger. The issue you should watch for updates is here.
However, please note that the Rado's solution to definine the GERRIT_REFSPEC parameter manually in build config can solve this problem temporarily if you build only one branch from Gerrit.
A workaround is available by adding the following JAVA_ARGS to /etc/default/jenkins on ubuntu
JAVA_ARGS="$JAVA_ARGS -Dhudson.model.ParametersAction.keepUndefinedParameters=true"
You could also add which variables should be allowed
JAVA_ARGS="$JAVA_ARGS -Dhudson.model.ParametersAction.safeParameters=GERRIT_REFSPEC,GERRIT_BRANCH
Looks like you ran a Jenkins Gerrit Trigger build manually? The trigger page says,
Using "Build Now"
[..]
Add a String parameter called GERRIT_REFSPEC with the default value refs/heads/master
https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger
After solving this issue if Jenkins is still not pulling the latest code commit(un-merged) then, need to Add Additional Behaviours -> Strategy for choosing what to build -> Gerrit Trigger
Reference: Thanks to Fabian

Resources