I am using Jenkins server with perforce. My build get stored in a local repo path in ".zip" format which contains all the file including (say) abc.properties. This file contains data:
#Thu Jun 09 12:13:14 MSD 2011
In this abc.properties file
BuildNumber = 0 is a default value(set in perforce). My old build system updates the
BuildNumber value with current build number in the zip file.
How can I achieve the same in Jenkins.
Thanks in advance.
Use maven or gradle for this, jenkins is not a build tool.
Add a post build step. This assumes you are running Unix and have sed on the path.
sed -i -e '/BuildNumber =/ s/= .*/= "$BUILD_NUMBER";/' abc.properties
Also, I could not disagree more with the selected answer. Jenkins is a build tool.
Jenkins focuses on the following two jobs: Building/testing software projects continuously https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins
I am not sure what kind of build do you run. If you have a maven or ant project, these two frameworks will update the property file if you ask them to.