What Are We Trying to Do?

This lesson defines goals and constructs that we will learn in this chapter.

It would be silly to explore the Jenkins X pipeline syntax in more depth using random and irrelevant examples. Instead, we’ll define some real and tangible goals. It doesn’t matter whether they fit your specific needs since the objective is for them to guide us in our effort to learn by producing concrete outcomes.

Defining some goals

Our next mission is to accomplish the following tasks:

  • Add code coverage reports.
  • Ensure that functional tests are executed only after a release rolls out.
  • Build a version of our application binary for each of the popular operating systems (e.g., Windows, macOS, and Linux).

Now, you might think that those goals are useful, or you might feel that they are a waste of time given your context; our real objective is not to accomplish those goals but to use them as an excuse to learn some additional constructs that might come in handy.

Constructs to learn

They will force us to learn the following few new things.

  • We’ll add names to pipeline steps.
  • We’ll learn how to define multi-line commands.
  • We’ll start using additional environment variables.
  • We’ll define custom agents.
  • We’ll learn how to override pipelines, stages, and steps defined in build packs.
  • We’ll learn how to implement loops.

Those are only a fraction of what we could use. But, we need to start somewhere, and we have a set of improvements to our application that we’ll be able to implement using the aforementioned concepts. Later on, it’ll be up to you to expand your knowledge of pipeline constructs by exploring the other definitions we can use.

📝 You might find these improvements useful as they are, or you might think of them as things you do not need. Both options are OK since the goal is not to show you how to add specific steps like code coverage, but rather to showcase some of the pipeline constructs that we might use in the context of our projects. All in all, focus on the value brought by additional pipeline instructions and not on the examples I’ll use to demonstrate how those constructs work.

Get hands-on with 1200+ tech skills courses.