We have a Spring Boot application.
It has a source/resources/properties/application.properties file, which is a fallback/base properties for all environments.
It contains the line:
app.buildNumber=%BITBUCKET_BUILD_NUMBER%
I have a set-build-number.sh script which runs before the Maven build, and basically does this:
PROP_FILE=$BITBUCKET_CLONE_DIR/platform/src/main/resources/application.properties
echo "Setting build number to: $BITBUCKET_BUILD_NUMBER in properties file: $PROP_FILE"
sed -i".original" -e "s/%BITBUCKET_BUILD_NUMBER%/$BITBUCKET_BUILD_NUMBER/g" $PROP_FILE
grep "app.buildNumber" $PROP_FILE
<span>And in the build logs, I see the following:</span>
<span>Setting build number to: 3795 in properties file: /opt/atlassian/pipelines/agent/build/platform/src/main/resources/application.properties</span>
<span>app.buildNumber=3795</span><span>+ ./scripts/set-build-number.sh</span>
So, everything looks fine so far.
<span>However, when I look at value returned by the application (via REST API), it is still set to the original placeholder value.</span>
What am I doing wrong?
Thanks.