I have some Jenkins pipelines, and on failure they send a -1 Verified response back to the gerrit review that triggered it. I also have the Build Failure Analyzer plugin, which I used to scan the console log for failure causes when the job fails.
On an older Jenkins installation (that I didn't manage), I used to get this failure cause back in the -1 Verified response in the gerrit review if one was found. I don't have that working at the moment.
Does anyone know if there is some gerrit trigger configuration needed, or another plugin to use to enable this?
Related
I have the following requirement. I have a Jenkins pipeline which I want to be triggered once a Bitbucket pipeline has been finished with success. The problem is that I need to pass also some params and I don't want to use an asynchronous process like Bitbucket webhooks.
Is it another way to trigger the Jenkins pipeline automatically receiving multiple params?
I want to mention that these params can be retrieved also from the AWS resources created by that Bitbucket pipeline.
I faced the same issue, but i found a solution using Additional Behaviours
from git plugin.
Using Polling ignores commits with certain messages, which allow you to:
ignore any revisions committed with message matched to the regular expression pattern when determining if a build needs to be triggered.
and am using [skip ci] int the commit message, to commit changes after Bit-bucket pipeline finished.
so i used a custom regex ^(?!.*\[skip ci\]).*$ to skip any commit not including the tag.
which will result to only trigger Jenkins once the pipeline finished.
I integrated Bitbucket with Cloudbees, having the following workflow: everytime an user creates a Pull Request, having as target develop branch, a multi-branch pipeline in cloudbees will cluster the pull request (e.g. PR-34) and it will trigger the first build (#1). If it passes, then everything is ok and bitbucket will show the build status as "passed".
However, if the build fails, it means that the user should trigger another one on the same pull request (PR-34 #2). If the second build passes, I expect to have the build status as "passed" but I get "1 build failed", due to the first build and no matter how many passed builds I will have in the future, the status will always remain as failed if at least one of the builds failed.
So, in order to resume the problem I need help on those following topics:
How should I configure bitbucket pull request status to show me the result of the latest build?
How should I constrain the merge checks so that users will be able to merge a pull request only if the latest build passed? Note: the check "Minimum successful builds" will not work since the behavior is the following: "If there are more builds than specified, they are all required to be successful in order to merge the pull request."
I've created a build in TeamCity for a project which uses GitVersion to manage versioning. When I attempt to have TeamCity run the build it fails showing the following error in the build log:
An unexpected error occured:
LibGit2Sharp.LibGit2SharpException: authentication required but no callback set
I have tried searching google for the LibGit2Sharp error, but find only a couple of closed bug reports with no details how they were able to work around the error.
After setting up the build's artifacts to capture the log output GitVersion was generating, the following message was found:
TeamCity doesn't make the current branch available through environmental variables.
Depending on your authentication and transport setup of your git VCS root things
may work. In that case, ignore this warning.
In your TeamCity build configuration, add a parameter called `env.Git_Branch` with
value %teamcity.build.vcs.branch.<vcsid>%
See http://gitversion.readthedocs.org/en/latest/build-server-support/build-server/teamcity
for more info
By setting the env.Git_Branch parameter to the %teamcity.build.vcs.branch.% value, GitVersion started working. This should have been a straightforward solution, but because the logs were not being captured and search results for the error message were unsuccessful, I've decided to post this answer to help others who may encounter this problem.
We have updated our Jenkins CI tool to updated version number is: 1.596.1. The problem is, for some projects, we cannot see the build console log. When we try to see the log, Jenkins responds with 404 error page.
Also, when this problem occurs in a particular job, we have examined that, failed builds are not be shown in the build history list in the job page. Even though we see that there is build from the gerrit history, when I click on the job with the specified ID, I again get the 404 error.
We are using Jenkins with Git/Gerrit, and most builds are triggered from the Gerrit review system.
New information: Jobs that have this problem have also the inconsistent timestamp problem.
It seems that this problem also occurs when Jenkins job is triggered by a patchset creation/merge in Gerrit review system.
What may be the root cause for this problem? Is it the version we're using or some other factor?
This is a persistent problem with Jenkins. A restart, which you can do from the front page when you're authenticated, is the fix. Visit
https://yoursite/jenkins/quietDown
to restart the instance.
I'm currently using Jenkins(1.451) and the Gerrit Trigger(2.3.1) to launch builds from Gerrit in order to verify code.
This is working fine as long as the project in Jenkins is configured as a "Free style" project. However, I'm currently setting up a new build pipeline where I'm using the "Build a maven2/3 project" option in order to take advantage of maven specific properties which I can't get from the "Free style" option. For some reason, Jenkins doesn't seem to trigger builds using this option. Nothing at all happens when I submit code to Gerrit which under normal circumstances should be picked up. I'm actually wondering if the Gerrit trigger is meant to work with Jenkins projects configured as a maven2/3 job or maybe it is the case that I can only use the Free style option in order to do this.ge
Could anyone confirm if this is the case?
Yes this will work. I suspect you might have some authentication issues that causes your jobs not to be triggered.
Check you sshd_log in the gerrit config folder to see if there are any jenkins logins that result in immediate LOGOUT. I my case I forgot to add Stream Events rights to the Non-Interactive Users under All-Projects and this caused some strange behavior.
This was the message I saw 3x per second in my sshd_log:
jenkins a/1000002 gerrit.stream-events 0ms 0ms not-admin
See here for more details