Jenkinsfile : Posting test info back to github? - sonarqube

I am using a Jenkinsfile to build build pull requests (declarative pipeline) , I want to push test results (one line) , code coverage(cobertura) and if possible SONAR back into the pull request in a fairly simple fashion.
I looked at some docs and added
junit 'target/surefire-reports/*.xml
but it doesn't post anything back to the pull request in github.

As far as I know, you cannot push test results back to GitHub without actually using git commit/push. What you can actually do is to create a webhook (setup guide) on GitHub and on Jenkins so that the build result is showed on GitHub and clicking on that link can redirect you to the Jenkins server.
Example
For Sonar I am sure there is a webhook as well, but I haven't used it personally.

Related

Is there a way to hide all the HTTP request logs from the node terminal output?

When I run a suite of tests using Cypress, I get a TON of HTTP request logs to the terminal output. I think this image best shows the issue. In it, you can see the command I run to start cypress, and that following it comes a long list of every HTTP request made during the tests.
Is there a way to hide them all?
You can add the following to cypress.json:
"morgan": false,
The logs you see are from express (a built-in server within cypress).

How to Post PR comment from jenkinsfile

I am running Multibranch pipeline jobs using Github plugin with the option below
and periodical polling (5 mins) to look for open pull requests (new feature branches in our case). Open pull request is identified, job is triggered and on successful completion am able to update the status. would like to add a PR status message with URL using
pullRequest.comment('This is a comment sent from the Pipeline').
But pipeline job fails with
"No such property: pullRequest for class: groovy.lang.Binding".
on further inspection, env.CHANGE_ID is set to NULL (means it is not a PR build job which is a prerequisite to use pullRequest module). can anyone suggest some idea to get CHANGE_ID set or means to post/update comments to PR other than success or Fail

trigger TeamCity build when comment on GitHub pull request

I'd like to trigger build by commenting specific message on the pull request, like: "Build again."
I allowed all 'commit', 'PR', and 'comment' things to GitHub-TeamCity hook.
Then I tried with VCS Trigger's 'comment' rule, but no luck.
I'm used to triggering build by comment with Jenkins using this plug-in: https://plugins.jenkins.io/github-pr-comment-build
Is there any plug-in or instructions for TeamCity?
I've looked this SO, and I agree with the chosen answer. However, I found that triggering something via comment is quite handy, and it gives more extensibility such as Slack integration.
TeamCity trigger for Github comment on pull request

how to get latest commit ref on giblit post commit hook

I am trying to get branch name of the last commit pushed to git that triggered my post-commit groovy script, anybody has an idea that how can I do this??
There are many examples of how to get that info. Try this one: https://github.com/gitblit/gitblit/blob/master/src/main/distrib/data/groovy/blockpush.groovy
The important thing to remember is that git can push multiple refs (branches & tags) simultaneously so it's easy to receive more than one.

Getting a 404 using App Harbor and BitBucket

I'm new to AppHarbour and I'm trying to deploy my MVC app on a free account.
I keep getting a 404 error.
The app is coming from Bit-bucket and it was deployed successfully.
In my Hostnames section i see the following
so i have added the following to the Hosts file in my machine:
176.34.122.158 camelotfaultmanagement.apphb.com
but i still get a 404 ..
What am i doing wrong ?
And a follow-up question how can i edit one of the files to be able to edit the connection ?string to my DB?
It looks like you may not have any successful builds yet - You have to push to Bitbucket to trigger your first build. You can see a list of builds on the app dashboard: https://appharbor.com/applications/camelotfaultmanagement
To use the built-in .apphb.com domain, you don't have to mess with any DNS setup.

Resources