File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
lib/java_buildpack/framework
spec/java_buildpack/framework Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,8 @@ def release
5050 java_opts . add_system_property ( 'dd.service' , "\\ \" #{ app_name } \\ \" " )
5151 end
5252
53- return unless @application . details [ 'application_version' ]
54-
55- version = @configuration [ 'default_application_version' ] || @application . details [ 'application_version' ]
53+ version = @application . environment [ 'DD_VERSION' ] || @configuration [ 'default_application_version' ] ||
54+ @application . details [ 'application_version' ]
5655 java_opts . add_system_property ( 'dd.version' , version )
5756 end
5857
Original file line number Diff line number Diff line change 107107 end
108108 end
109109 end
110+
111+ context 'when dd_version environment variable is provided' do
112+ let ( :environment ) do
113+ super ( ) . update ( { 'DD_VERSION' => 'env-variable-version' } )
114+ end
115+
116+ before do
117+ FileUtils . mkdir_p File . join ( context [ :droplet ] . root , 'datadog' )
118+ end
119+
120+ after do
121+ FileUtils . rmdir File . join ( context [ :droplet ] . root , 'datadog' )
122+ end
123+
124+ it 'release updates JAVA_OPTS with env variable version' do
125+ component . release
126+
127+ expect ( java_opts ) . to include ( '-Ddd.version=env-variable-version' )
128+ end
129+ end
110130end
You can’t perform that action at this time.
0 commit comments