File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
lib/java_buildpack/framework
spec/java_buildpack/framework Expand file tree Collapse file tree 2 files changed +13
-6
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 if @application . environment . key? ( 'DD_VERSION' ) || !@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 110110
111111 context 'when dd_version environment variable is provided' do
112112 let ( :environment ) do
113- super ( ) . update ( { 'DD_VERSION' => 'test-application -version' } )
113+ super ( ) . update ( { 'DD_VERSION' => 'env-variable -version' } )
114114 end
115115
116- it 'release updates JAVA_OPTS' do
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
117125 component . release
118126
119- expect ( java_opts ) . not_to include ( '-Ddd.version=test-application -version' )
127+ expect ( java_opts ) . to include ( '-Ddd.version=env-variable -version' )
120128 end
121129 end
122130end
You can’t perform that action at this time.
0 commit comments