Automating WebHooks

299 views
Skip to first unread message

alan...@gmail.com

unread,
Aug 24, 2017, 9:10:10 AM8/24/17
to SonarQube
Hi,

I'm providing a CI service with Jenkins & Sonar - I cannot figure out how to pre-populate:

sonar.webhooks.global

I have tried

-Dsonar.webhooks.global=[{"
name":"Jenkins","url":"http://pipeline.XXXX.io/jenkins/sonarqube-webhook/"}]

and I have tried

sonar.webhooks.global=1
sonar.webhooks.global.1.name=Jenkins
sonar.webhooks.global.1.url=http://pipeline.XXX.io/jenkins/sonarqube_webhook/

but neither are applied - I have to create this every time I bring my sonar container (dockerised) up  - this breaks builds as Sonar cannot make callbacks...

Any ideas?

G. Ann Campbell

unread,
Aug 24, 2017, 9:32:35 AM8/24/17
to SonarQube, alan...@gmail.com
Hi,

Have you tried setting these properties through the UI? They're stored in the database, so assuming continuity on that end, they should still be there when you start back up.


Ann

Alan Ryan

unread,
Aug 24, 2017, 9:38:27 AM8/24/17
to G. Ann Campbell, SonarQube
Hi Ann,
Thanks for that - I have applied them manually and they do get persisted.

I'm being a bit perfectionist and trying to get the package (tf/docker/aws ecr/aws ecs) out of the box  / turn-key so that I can open source it.

This manual step (amongst others) is a blocker for me.  I am also looking into a Post Sonar Up - HTTP POST to create the same...  but a way of passing these in at launch or during the docker build would be super.

Al

G. Ann Campbell

unread,
Aug 24, 2017, 10:24:04 AM8/24/17
to SonarQube, ann.ca...@sonarsource.com
Hi Al,

There are only a few things you can set from sonar.properties, and if you notice, they're not settable from the UI. And vice versa.


Ann

Alan Ryan

unread,
Aug 24, 2017, 10:32:20 AM8/24/17
to G. Ann Campbell, SonarQube
Much appreciated.

Thanks
Al

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/4mU0_H3av5c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/434db16a-1f98-470d-93b0-c4260e5c94e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Brandhof

unread,
Aug 24, 2017, 10:41:32 AM8/24/17
to Alan Ryan, G. Ann Campbell, SonarQube
An option is to use the web service api/settings/set (documentation) after first startup.
Note also that it's planned to create a web service dedicated to creation of webhooks (SONAR-9058), in order to not deal with the multiple underlying properties.

You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/CAHLByPH_qa4ivRwvbiacbfbkJjTqoU-3kJ0ptXsXPManJTEM9A%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.
--

Simon Brandhof | SonarSource

Co-Founder & Tech Lead

@SimonBrandhof

http://sonarsource.com

Alan Ryan

unread,
Aug 24, 2017, 10:43:07 AM8/24/17
to Simon Brandhof, G. Ann Campbell, SonarQube
Hi Simon,
Thanks, I'll investigate a means of automating that, and I'll post back here with any successes.

Al
Reply all
Reply to author
Forward
0 new messages