I'm using the Export parameters plugin. I want to export the build number to a file.
I'm using string parameter:
jenkins-build
${BUILD_NUMBER}
Export to properties file using key:
jenkins-build
But the exported file does not update the build number. I get:
jenkins-build=${BUILD_NUMBER}
Do I need to do something else?
Your configuration using these plugins should work if you manually input BUILD_NUMBER at the time of triggering a build. However, you may also use below build steps for your requirement.
Linux Platforms - Execute shell
echo "jenkins-build=$BUILD_NUMBER" > /path/to/file.properties

Windows Platform - Execute windows batch command
echo jenkins-build=%BUILD_NUMBER% > Drive:\path\to\file.properties

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With