In some cases, you would like to use Jenkins declarative pipeline with the dynamic agent. For instance, you want to provide a list of available agent nodes as a parameter for the pipeline job. In this blog post, I will explain how you can configure such a behavior in just a few steps.
Do you know that you can unit test your Jenkins pipeline code? Have you ever used linter to validate the syntax of the Jenkinsfile? Do you use
input step with a long timeout that blocks the executor and you don’t know how to improve? I answer those three questions (and two more) in the following YouTube video.
In this blog post, I explain why you may want to use
curl command in your Jenkinsfile, how to catch
curl response and store it in a variable, as well as how to read HTTP response status code and extract some data from the JSON document. Enjoy!
The declarative Jenkins Pipeline allows us to define timeout either at the pipeline level or the specific stage. This feature prevents Jenkins’s job from getting stuck. However, in some cases, we want to accept that one stage may timeout, but we want to keep the remaining stages running.
If you read this blog post, there is a high chance you’re looking for information about practical differences between scripted and declarative pipeline, correct? You couldn’t find a better place then. I’m going to show you the four most practical differences between those two. Stay with me for a few minutes and enjoy the ride!
In one of the latest blog posts, I have shown you how you can build a Docker image with Java and Maven installed with the SDKMAN! command-line tool. Today I would like to continue the topic and show you, how you can compile your project using two different Java versions in parallel.
A few days ago, I was struggling with some Docker images I use in my Jenkins CI environment. I run some Jenkins Pipelines, and I like to define build environment as code using custom Docker images. Everything was fine until I had to consider running different Java or Maven versions. I decided to use one of my favorite command-line tools - SDKMAN!, to build a highly configurable build environment.
Have you run into troubles when you started using Jenkins Environment Variables in your
Jenkinsfile? In this blog post, I show you how to use environment variables, how to override them, how to work with
boolean values, and how to store a result of
sh step in the env variable. After reading this article, Jenkins env variables won’t surprise you anymore!