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

Commit

Permalink
feat(framework): "Null" support added
Browse files Browse the repository at this point in the history
Resolves #47
  • Loading branch information
Igor Rzegocki committed Sep 14, 2016
1 parent 89252b3 commit b9e7b63
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ then [add recipes to the corresponding OpsWorks actions](#recipes).
* SCM
* git
* Framework
* Null (no framework)
* Ruby on Rails
* App server
* Null (no appserver)
Expand Down Expand Up @@ -141,7 +142,7 @@ Pre-optimalization for specific frameworks (like migrations, cache etc.).
Currently only `Rails` is supported.

* `app['framework']['adapter']`
* **Supported values:** `rails`
* **Supported values:** `null`, `rails`
* **Default:** `rails`
* Ruby framework used in project.
* `app['framework']['migrate']`
Expand Down
10 changes: 10 additions & 0 deletions libraries/drivers_framework_null.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true
module Drivers
module Framework
class Null < Drivers::Framework::Base
adapter :null
allowed_engines :null
output filter: []
end
end
end
4 changes: 2 additions & 2 deletions recipes/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
user node['deployer']['user'] || 'root'
group www_group
rollback_on_error true
environment application['environment'].merge(framework.out[:deploy_environment])
environment application['environment'].merge(framework.out[:deploy_environment] || {})

keep_releases deploy[:keep_releases]
create_dirs_before_symlink(
Expand All @@ -50,7 +50,7 @@
end
end

migration_command(framework.out[:migration_command])
migration_command(framework.out[:migration_command]) if framework.out[:migration_command]
migrate framework.out[:migrate]
before_migrate do
perform_bundle_install(shared_path, bundle_env)
Expand Down
16 changes: 16 additions & 0 deletions spec/unit/libraries/drivers_framework_null_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'spec_helper'

describe Drivers::Framework::Null do
it 'receives and exposes app and node' do
driver = described_class.new(aws_opsworks_app, node)

expect(driver.app).to eq aws_opsworks_app
expect(driver.node).to eq node
expect(driver.options).to eq({})
end

it 'returns proper out data' do
expect(described_class.new(aws_opsworks_app, node).out).to eq({})
end
end

0 comments on commit b9e7b63

Please sign in to comment.