Why is Coverity Scan stopping abruptly in my Travis CI build with no error message - travis-ci

My Travis CI build invokes Coverity Scan, which terminates abruptly with no error message. The last two lines of output are
Coverity Scan analysis selected for branch master.
Coverity Scan API a
The Travis CI build then error-terminates.
Here is the complete output from my latest Travis CI build.
And here is my .travis.yml file.
Anyone have any ideas?

Related

How to fail jenkins job if the sonar project does not pass Quality gate stage

I am trying to run my sonar scanner from jenkins and I want my jenkins job to fail when the Quality gate at sonar is not met.
I have configured sonar host and sonar scanner with jenkins at global tool level, my project analysis is uploaded in sonar, but the jenkins job is still passing. what am i doing wrong.
so, basically I am trying to achieve this https://blog.sonarsource.com/breaking-the-sonarqube-analysis-with-jenkins-pipelines/ , I can do it via pipelines, but I want to achieve the same thing via a jenkins job.
Here is my job
just clone a project and run sonar scanner.
this is the build step
git clone 'https://github.com/SonarSource/sonar-scanning-examples.git # clone
cd $WORKSPACE # goto cloned workspace
Here are the properties passed to sonarscanner
Analysis properties:
sonar.projectKey=org.sonarqube:sonarqube-scanner
sonar.java.binaries=.
sonar.qualitygate.wait=true
I believe sonar.qualitygate.wait=true this is the extra step that I need to do at sonar scanner step.
I want my jenkins job to fail, as soon as Quality gate fails.

Jenkins Pipeline - Can we restart jenkins pipeline again with the same build number?

I am using jenkins pipeline and when I try replay or restart from stage option in case of any build failure, it is creating a new build.
Example: One of the job in pipeline is to do scp of build to remote location. So when this got failed I tried replay and restart from stage option, but it again started generating new build.
So what can I do to generate build again with the same failed build number instead of new one?

Sonar scanner execution order jenkins job

For my project, we have made the job on Jenkins GUI. Non declarative.
Tasks are :-
GIT scm
Maven clean install goal
Sonar scanner
Quality gate
War to artifactory
I have defined, sonar scanner in post build steps and deploy to artifactory in post build actions.
Now in console output, order of execution is like war is getting published first and then sonar scanner runs code quality check.
However, i want sonar scanner to execute first.
Can someone please guide me on how i can achieve this ?
Are you using the Sonar Scanner for maven plugin?
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-maven/
You should just be able to add 'sh mvn clean build sonar:sonar' in your Jenkins pipeline and the plugin will do the rest. It will run the unit test, run jacoco if you have it configured, and report it back to sonar.

Is there any sample solution about bitbucket pull request(not cloud) which is triggering sonarcube analyze on jenkins?

we would like to start a sonarqube analyze on developers' branches (bitbucket) just before pull requests via jenkins . Is there a sample solution?as far as i understood "sonar for bitbucketserver" plugin only shows the analysis results it does not trigger sonarqube analysis . Our scanner will be on jenkins
without a CI tool I was able to trigger analysis by adding the plugin sonar-stash to sonarqube. This way integrating with Bitbucket. Command I executed in sonarqube server, under sonar-scanner/bin folder:
./sonar-scanner -Dsonar.analysis.mode=preview
-Dsonar.stash.notification=true
-Dsonar.stash.project=JAVA
-Dsonar.stash.repository=abcd
-Dsonar.stash.pullrequest.id=2
-Dsonar.stash.password=**********

Failing a build in Jenkins using the Quality Gate plugin

I m trying to fail a build in my Jenkins server using the Quality Gate plugin (v2.5). In my jenkins i have installed SonarQube plugin (v2.4.4) and SonarQube Scanner v2.6.1. I have configured a SonarQube server as well v5.6
I have defined a quality gate (for eg bugs > 10) in my server for the project which i m building using my Jenkins server. I have created a freestyle job for the same in Jenkins. What i want to achieve is the build in Jenkins should fail whenever the Quality Gate requirement is not met.
I use the "Execute SonarQube Scanner" option in my build step in Jenkins and the Quality Gate option in the post build action (with my project key). I have defined the parameters for sonar analysis in the Analysis Properties section.
Currently, when the quality gate threshold is not met the status changes to failed on the SonarQube server but the build is passed in Jenkins. During the next execution of the same job in Jenkins the build is failed by the Quality Gate. That is the build status is not changed in synchronization with the SonarQube server but in the following execution,
Can you pls let me know what m i missing here ?
it's been a while since you posted this but maybe I can help at least with my understanding.
In SonarQube 5.6 (don't know when this changed) the build analysis is been analysed in a background task in SonarQube. So the Jenkins Build is finished after it posted the analysis to the server and the build is finished long before the background task on the SonarQube server is finished.
During or on the end of the background task in SonarQube it checks the QualityGate.
So the Jenkins plugin get's always "outdated" QualityGate status at least with SonarQube versions higher than 5.6.
It's possible to extend the Jenkins plugin and add a "wait for background task" option. Of course this would lead longer build times in Jenkins. This is already done in this fork of the "Quality Gates Plugin".
Hope this all right :-)
see the also the doku here

Resources