How to set a constant in Jenkins DSL

Working with the Jenkins DSL configuration is quite easy. But we need to remember about best practices and do some work for ourselves. Just to simplify out live. One of these things is creating good code. We should extract repeating code blocks and use them in different places. Let’s assume, that we want to create granular permissions – Alice has permissions only for Job A, but Bob has permissions for both, Job A and Job B. As you see, we have now two jobs and two users. But we don’t know when we will have to add more users. And Continue reading

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 Job DSL Playground Docker image

I have been using Jenkins Job DSL Playground since I realized that DSL is the best option for managing Jenkins jobs. If you have a lot of them, changing anything can be very painful without any automation. Jenkins DSL Plugin allows transforming configuration into the code and store that in the Git repository. But, you know, sometimes changes are very complex and you can make a mistake, hence I needed something that helps me. And I found it – Jenkins Job DSL Playground. It was obvious for me, that I can also use a docker image, but I couldn’t find Continue reading