Jenkins DSL Authorization Matrix loop

Authorization Matrix is one of my favorite Jenkins functionality. It allows managing permissions per Project what gives enough granularity. But when you have a lot of Projects, you can find Jenkins DSL Plugin very helpful. Especially when you start your adventures with Jenkins, those two plugins can make your life easier. As you use Jenkins, I suppose you are in love with automation. You try to automate and optimize everything. And if you read this post, it’s more than certain that you faced the same problem I had faced in my work. How to create a Jenkins DSL Authorization Matrix Continue reading

Jenkins Job DSL Playground – how it works

Working with Jenkins Job DSL code sometimes is a pain in the neck. Especially if you have very big and complex scripts. You can make a mistake very quickly, so it would be great if there could be a way to test your code before the seed deployment. Of course, you can test your DSL scripts outside of Jenkins, but sometimes you don’t need to run the whole bunch of tests, right? You just want to check only the small part of your code… What if I tell you that you can do that? Ladies and gentleman, let me introduce Continue reading

Jenkins – unable to resolve class utilities.MyUtilities

It’s more than likely, you start trying to import external classes/files if you use Jenkins Job DSL Plugin. When your jobs grow to tens or hundreds of projects, some code will be common in some places. So, you will read the documentation, check the community forums, try to find out the best way to simplify your life. And you find it. You will find very quickly, that you can import classes from external files. Jenkins DSL uses Groovy, and Groovy is based on Java, after all, so it’s not a surprise. After you find that information you will try to Continue reading

Variable as a Groovy map key

Maps are the structures which can be very helpful. I’m not a developer, so I’m sure that many of you will take this post with a grain of salt. Even though, If you use Jenkins, you can face the same problem I faced some time ago. My experience with Groovy is limited to Jenkins job DSL configuration, but I always try to create a configuration as simple as possible. So sometimes my scripts are full of loops, conditionals, and variables. In one of my job, I tried to use a map and create a nested loop, where one of the Continue reading