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

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

Jenkins build priority

Jenkins has many ways of managing the job queues. We can add a static slave node, use the plugin which creates temporary nodes or just add more workers to the existing servers. But sometimes we need something else. We need a possibility to set the priority of the job. It’s not possible with additional workers or nodes, hence we should use the other way. And Priority Sorter Plugin can solve our problem. Very quickly and easy, trust me. From now, Jenkins build priority will not have any secrets! Jenkins build priority? For what?! Let’s assume such situation: We have a Continue reading

Ansible – boolean variable in extra vars

Passing variables to Playbook with extra vars flag is something normal during the daily work. Even though Ansible offers two ways to do that, you can face the problem when you need to set the true or false values. You should not do something like —extra-vars “foo=true” with the boolean values. I know, it’s quite annoying, but we need to deal with it. So, if you read this post, you wonder how you can pass the boolean variable in extra vars. And now I want to tell you how to do that in a proper way. Variable Precedence First, let’s Continue reading

Jenkins e-mail notification with Office365

Jenkins is a great tool for automation and building the Continuous Integration and Continuous Delivery/Deployment (whatever you want) systems. But the more jobs you create, the more complicated Jenkins will be. Hence you should have some tools for monitoring whether everything is ok. The most basic way to monitor Jenkins’ jobs is e-mail notification. More and more companies choose Office365 as their e-mail service. Today I will show you how to configure Jenkins e-mail notification with Office365 because it’s not so obvious as you may think. I don’t want to show you how to configure and run Post Build Publisher, Continue reading

Free IT e-books with Jenkins

Maybe some of you know PacktPub – part of the Pack Publishing Limited Company. They publish once a day a free IT e-books, which can be saved and downloaded from the account. Every day one can download another e-book from the very big library. It’s a really really great possibility, but it has one, serious problem. We must remember to take a look at the page every day. Without this, we may miss something interesting. Moreover, manual checking is not what we want to do. You wouldn’t be there if you like doing manual things, which can be done automatically! Continue reading

How to run Jenkins with docker?

Sometimes no one wants to deploy and configure the whole server and applications. Especially when the time is the scarce resource. Developers know about it – they face this problem every day. One of the solutions is docker. It helps with deploying, provisioning and automating development and production environments without the big workload. Docker can help also with learning. You do not need the create separated virtual machines for your labs. The only one you need is docker and your own notebook/PC. Forget about long configuration processes and subsequent work expenditures (removing, cleaning etc.). If you want to learn some Jenkins, Continue reading

Deploying multiple vSphere VMs with Terraform

Automation doesn’t mean only the ability to automate some process and repeating it over and over again. It means also the ability to automate every automated process – if it’s possible of course. So even if we can automatically deploy VM, why shouldn’t we try to deploy multiple machines? Everything is fine until we need to deploy three, four or more same virtual servers. It would be very annoying unless we automate also this process – process of deploying multiple vSphere VMs with Terraform. If you haven’t read my previous article, you can do it here: Deploying vSphere VM with Terraform. Continue reading