If you not use tools like Burrow or Kafka-Manager, this might be helpful :-)
Beside the shipped console consumer and producer Kafka can receive and deliver messages from and to several technologies. Here’s just to remember some simple groovy implementations:
If you operate several Jenkins masters with dozens of slaves, you might end up one day on a slave without knowing to which master it is connected. In case the master establishes the connection to the slave, following snippet will help
Artifactory provides a nice API for retrieval of several data. If you need a list of all remote repo keys you can use following script:
If you like to find out how many connections your Artifactory is using for dealing with its configured remote repositories, there is no obvious way to do that. Instead there’s a simple way to monitor the leased, pending, available and max connections via Artifactory’s built-in JMX-beans.
When dealing with jenkins views you will soon realize that this is not that easy as unlike Jenkins jobs or many other configuration stuff, views are not saved in a separate config file or location.
This post is about „How to build your own pluginnable application“. As a playground example I want to create a core application that is easily extendable by just putting a plugin-jar into a plugins folder.
Just a small example to show how to use sbt instead of classical maven to build a java program and deploy it to Nexus repo manager.
It may happen, that you wish to specify a custom location of your logfile when running your Java app. Within this post I use an example cli application that is written in Groovy and build with Gradle.
When playing around with the concepts of Continuous Integration/Delivery/Deployment I struggled over Gradle builds and how to integrate them in these concepts.
Jenkins can be configured in many ways. When trying to find a suitable solution for deployment of plugins, we’ve been facing to the problem of using not (!) the latest and greatest plugin versions. This can be necessary when using the jobdsl plugin without having the resources to update our own dsl library when there comes up a non-downstream-compatible version of the jobdsl plugin. But this is only one example, there are more 🙂
With version 1.8 a great feature got into the release of Groovy: the groovy.util.logging.Slf4j-annotation. With that annotation you can create the logging facade which can be used then at runtime with different logging implementations. In this example I will use „simple logging“, „log4j“ and „logback“ as implementations.
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 will 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.
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 is a small helper script that triggers the job and waits until it gets executed in order to return the concrete build url.
Here is how to easily set the description of a Jenkins build via curl:
Here is a small example about how to use yaml for controlling dynamic loading of classes in groovy.
Sometimes it becomes necessary that you connect two machines without entering passwords. This could be for example in case of service or machine accounts. Therefor this secure shell can be established by authorization via priv/pub keys.
When playing around with state-of-the-art technologies, I struggled over Nginx (called Engine X) that aims to be the new hot stuff within serving static and dynamic content. I’ve been aware of using Apache HTTP server for loadbalancing, so I wanted to try out how difficult it would be to use Nginx.
Java statics might be a bit mysterious for beginners. Here’s my clarification for myself :