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.
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.0.1
) if you have just fixed some bugs.1.1.0
) if you have added some new features.2.0.0
) if you have removed some features or introduced breaking changesThis 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