rht-labs / labs-ci-cd

👻UNMAINTAINED - A collection of Red Hat Open Innovation Labs CI/CD components
Apache License 2.0
101 stars 70 forks source link

Have Jenkins Wait For Sonar to Come Up Before Initializing Sonar Testings #71

Closed sherl0cks closed 5 years ago

sherl0cks commented 6 years ago

A little error handling loop here on the init script would be good

https://github.com/rht-labs/labs-ci-cd/blob/master/s2i-config/jenkins-master/configuration/init.groovy.d/configure-sonarqube.groovy#L88

InfoSec812 commented 6 years ago

The plan is to use the post actions to set up an init container which will cause Jenkins to wait for SonarQube be ready before starting. In my demo repo it is working very well, but we will need post-actions in order to add the init container AFTER provisioning from the default Jenkins template.

sherl0cks commented 6 years ago

@InfoSec812 why do you need post actions for an init container? can that not simply be added to the inventory as a second template?

sherl0cks commented 6 years ago

also, don't you have to write the same logic in that init container? seems like more moving pieces than doing it alongside all the other sonarqube config.

InfoSec812 commented 6 years ago

The main benefit of an init container approach in my understanding is that the init container will not "time out" and fail.

oybed commented 6 years ago

The openshift-applier now has pre/post steps that can be utilized for this. Take a look at the following example and roles:

https://github.com/rht-labs/labs-ci-cd/blob/v3.9.1/inventory/group_vars/all.yml#L86-L87

https://github.com/redhat-cop/openshift-applier/tree/master/roles/openshift-route-status