Closed sherl0cks closed 5 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.
@InfoSec812 why do you need post actions for an init container? can that not simply be added to the inventory as a second template?
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.
The main benefit of an init container approach in my understanding is that the init container will not "time out" and fail.
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
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