...

/

Getting Rid of Repetition

Getting Rid of Repetition

This lesson discusses the downsides of Jenkinsfile based pipeline model.

Copying and pasting code is a major sin among developers. One of the first things we learn as software engineers is that duplicated code is:

  • Hard to maintain.
  • Prone to errors.

That’s why we are creating libraries. We do not want to repeat ourselves, so we even came up with a commonly used acronym DRY (don’t repeat yourself).

With that in mind, all I can say is that Jenkins users are sinful.

Identical Jenkinsfile in projects

When we create pipelines through Jenkins (or almost any other similar tool), every project gets a Jenkinsfile based on the pipeline residing in the build pack we chose. If we have ten projects, there will be ten identical copies of the same Jenkinsfile. Over time, we’ll modify those Jenkinsfile ...