I have an application that builds in Jenkins and that I want to deploy to Octopus. When I am doing this I have to create a release version that is send to Octopus. For this rele
Jenkins provides some environment variables available to each build command; one of those is the build number, an increasing number.
If you can accommodate with holes in your version numbers, change your version to include the build number, like 4.8-142 where 142 is the build number from jenkins. This gives you increasing version numbers in the semver sense and still let you control the real version in a more functional way.
If you are not happy with the build number in your version, then you should have a post build script that updates the version number and stores that in a file somewhere. You could then inject that file content with either the EnvInject plugin or using a parametrized build.