Reading configuration files with groovy can be easy if you know how 🙂 There are multiple formats the configuration can be served to an application, here we’ll have a look on xml, json and yaml.
Just another playground example. This time it demonstrates the usage of c3P0 for hibernate database environments e.g. for connection pooling. As this is a very basic example, there will be only a reduced UserController that listens on http://:
There are cases if you like to send the log output from Jenkins directly to a database for better querying or just as a step for further processing them. As Jenkins is not really admin-friendly with redirecting logs, we have to use the „init.d“ feature of Jenkins (https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Jenkins+upon+start+up). Thus you can simply put an init.groovy […]
It’s not that easy as it seems to obtain the conrete build url from Jenkins after invocation via curl. This is because of the scheduling/queuing architecture of jenkins, so here’s a small helper script that triggers the job and waits until it gets executed in order to return the concrete build url.