Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
fix(framework): Added missing deploy_environment to null framework
Browse files Browse the repository at this point in the history
Even if framework is set to null, at least `RACK_ENV` needs to be set. This gives application the
hint, which environment is currently used - which the app can interpret or not.

Signed-off-by: Igor Rzegocki <igor@rzegocki.pl>
  • Loading branch information
ajgon committed Sep 30, 2016
1 parent f8856c8 commit 673a21d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion libraries/drivers_framework_null.rb
Expand Up @@ -4,7 +4,11 @@ module Framework
class Null < Drivers::Framework::Base
adapter :null
allowed_engines :null
output filter: []
output filter: [:deploy_environment]

def raw_out
super.merge(deploy_environment: { 'RACK_ENV' => globals[:environment] })
end
end
end
end
3 changes: 2 additions & 1 deletion spec/unit/libraries/drivers_framework_null_spec.rb
Expand Up @@ -11,6 +11,7 @@
end

it 'returns proper out data' do
expect(described_class.new(dummy_context(node), aws_opsworks_app).out).to eq({})
expect(described_class.new(dummy_context(node), aws_opsworks_app).out)
.to eq(deploy_environment: { 'RACK_ENV' => 'staging' })
end
end

0 comments on commit 673a21d

Please sign in to comment.