vicky2926 Absent Member.
Absent Member.

How to replace the ${BUILD_NUMBER} variable in efs with jenkins build_number

Background: I have a repository say example.com along with master and develop branch. My master branch repo push the change to "/efs/prod" through jenkins and develop branch repo push the change to "/efs/qa" through jenkins build.

Requirement: Now with jenkins build I am pushing a file say index.php with below cloudfront distribution url.


So I just want to run the jenkins build in such a way that the build should update the ${BUILD_NUMBER} variable in index.php file with actual jenkins build number. In simple words how do we dynamically update the build number in the code pushed to efs.

I used above build-name-setter plugin to get the build_number but how could I dynamically update it in the index.php file and in all the efs files where we have ${BUILD_NUMBER} defined.
I have also tried to use EnvInject plugin but still not able to dynamically update the index.php with actual build number.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.