1

I'm currently learning how to implement semantic versioning for my project in Jenkins/Maven/Git, I read this article today, it seems like we can get incremented versioning automatically with Gitflow, what's the point of using semantic versioning then?

I'm new to all of them, still trying to figure out the relationships among them, and I searched online for days, there's no example or tutorials regarding how to implement SV, I also read this article , I understand what SV is but still no clue how it can be linked to Jenkins/Maven/Git. I found a Jenkins plugin called semantic-versioning-plugin, but can't find anything related regarding how to implement it.

I also tried to change the config in Jenkinsfile but it only change the build_number after every push to Git, but this is not what I want, I want the versions to follow the rules in SV.

It would be great if someone could explain or giving me an example so I can have a look. Many thanks.

2 Answers 2

4

SemVer is used to inform your customers about the context of an update. So if your piece of software currently has the version 1.0.0 and you want to release an update you have the following options to increment the version:

  1. Increment the PATCH (1.0.1) if you have just fixed some bugs.
  2. Increment the MINOR (1.1.0) if you have added some new features.
  3. Increment the MAJOR (2.0.0) if you have removed some features or introduced breaking changes

This way your customers know exactly what to expect and they can even automate the process of updating.

To implement this pattern in your workflow you can simply increment the version by hand every time you release an update. But you can also (and probably should) use tools that do this automatically for you. Most tools use a combination of git tags and either commit messages or manual triggers to implement this.

Perhaps this could be interesting for you: https://blog.armesto.net/automatically-versioning-your-application-on-jenkins-x/

If you want to learn more about SemVer I can also really recommend this talk by Stephan Bönnemann: https://www.youtube.com/watch?v=tc2UgG5L7WM

1

SemVer is not related to a specific piece of technology. You could use SemVer to describe the evolution of a recipe for cake. SemVer is simply a naming scheme.

  • You bumped the major version when you completely redid the cake recipe so it is log shaped instead of a standard layer shape.
  • You bumped the minor version when you added a new feature - sprinkles
  • You bumped the patch version when you fixed an issue where the cooks were adding too much salt, making it taste bad.

Various technologies will try to organize your software releases according to SemVer, but don't confuse it with a specific tool's behavior.

2
  • Thanks for the clarification, so we basically can implement it by using either Jenkins or Maven or we need to combine them together? Would be great if you have an example or throwing me some links. Thanks.
    – wawawa
    Nov 19, 2019 at 15:15
  • "Implementing SemVer" almost doesn't make sense, since SemVer is not a feature. You are adopting SemVer, and using tools to help you. You could mail out postcards to your customers with the version number on them and the code printed out below. That being said, both Jenkins and Maven can help you publish and maintain versioned releases. I can't give you any specific examples because the question is so high-level.
    – AlexMA
    Nov 19, 2019 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.