This repository has been archived by the owner on Dec 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from RapidRiverSoftware/nick/null-database-ad…
…apter Support null database driver
- Loading branch information
Showing
11 changed files
with
271 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module Drivers | ||
module Db | ||
class Null < Base | ||
adapter :null | ||
allowed_engines :null | ||
output filter: [] | ||
defaults username: nil, password: nil, host: nil, database: nil | ||
|
||
def can_migrate? | ||
false | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
test/integration/data_bags/maximum_override/aws_opsworks_app/other_project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"app_id": "3aef37c1-7e2b-4255-bbf1-03e06f07701a", | ||
"app_source": { | ||
"password": "3aa161d358a167204502", | ||
"revision": "master", | ||
"type": "git", | ||
"url": "https://github.com/RapidRiverSoftware/dumber-app", | ||
"user": "dummy" | ||
}, | ||
"attributes": { | ||
"auto_bundle_on_deploy": true, | ||
"aws_flow_ruby_settings": {}, | ||
"document_root": "", | ||
"rails_env": null | ||
}, | ||
"data_sources": [], | ||
"domains": [ | ||
"other-project.example.com", | ||
"other_project" | ||
], | ||
"enable_ssl": true, | ||
"environment": { | ||
"ENV_VAR1": "test" | ||
}, | ||
"name": "Dummy app", | ||
"shortname": "other_project", | ||
"ssl_configuration": { | ||
"certificate": "-----BEGIN CERTIFICATE-----\nMIICkzCCAfwCCQCs8PFrlPxmzTANBgkqhkiG9w0BAQUFADCBjTELMAkGA1UEBhMC\nVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExGDAWBgNVBAcTD1NpbGxpY29uIFZhbGxl\neTEWMBQGA1UEChQNb3Bzd29ya3NfcnVieTEWMBQGA1UEAxQNKi5leGFtcGxlLmNv\nbTEfMB0GCSqGSIb3DQEJARYQaWdvckByemVnb2NraS5wbDAeFw0xNjEwMjUxMzU4\nNDVaFw0xNzEwMjUxMzU4NDVaMIGNMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2Fs\naWZvcm5pYTEYMBYGA1UEBxMPU2lsbGljb24gVmFsbGV5MRYwFAYDVQQKFA1vcHN3\nb3Jrc19ydWJ5MRYwFAYDVQQDFA0qLmV4YW1wbGUuY29tMR8wHQYJKoZIhvcNAQkB\nFhBpZ29yQ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SjXUW+8eAEBJgGZlcjO7e\nJiKyyRZ8ZPQA5cJrHutISWK40uqPt/SOA2Rs2hur+W48t9WB+LOBwtvnPMkCQFyX\n84j6QmcQ+rkSYf0640hHENoI/IfNrTveIi8f5KT55uY4aV3JlqGnLbrTsNp/IBdq\ndRJ8DewA9ycOF01EN9kCQEJVMn/cgbTT4hNyte2ycyHxTSh1h5ImipV8khcopanV\naSxsp8mM4JwGSzWtfF9+EMVymZ2OsH7oSYfawzKjSGg=\n-----END RSA PRIVATE KEY-----\n" | ||
}, | ||
"type": "other", | ||
"deploy": true, | ||
"id": "other_project" | ||
} |
142 changes: 142 additions & 0 deletions
142
test/integration/maximum_override/serverspec/maximum_override_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'opsworks_ruby::setup' do | ||
describe package('ruby2.3') do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('libsqlite3-dev') do | ||
it { should_not be_installed } | ||
end | ||
|
||
describe package('git') do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('apache2') do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('redis-server') do | ||
it { should_not be_installed } | ||
end | ||
|
||
describe file('/usr/local/bin/bundle') do | ||
it { should be_symlink } | ||
end | ||
end | ||
|
||
describe 'opsworks_ruby::configure' do | ||
context 'webserver' do | ||
describe file('/etc/logrotate.d/other_project-apache2-production') do | ||
its(:content) do | ||
should include '"/var/log/apache2/other-project.example.com.access.log" ' \ | ||
'"/var/log/apache2/other-project.example.com.error.log" {' | ||
end | ||
its(:content) { should include ' daily' } | ||
its(:content) { should include ' rotate 30' } | ||
its(:content) { should include ' missingok' } | ||
its(:content) { should include ' compress' } | ||
its(:content) { should include ' delaycompress' } | ||
its(:content) { should include ' notifempty' } | ||
its(:content) { should include ' copytruncate' } | ||
its(:content) { should include ' sharedscripts' } | ||
end | ||
|
||
describe file('/etc/apache2/ssl/other-project.example.com.key') do | ||
its(:content) { should include '-----BEGIN RSA PRIVATE KEY-----' } | ||
end | ||
|
||
describe file('/etc/apache2/ssl/other-project.example.com.crt') do | ||
its(:content) { should include '-----BEGIN CERTIFICATE-----' } | ||
end | ||
|
||
describe file('/etc/apache2/ssl/other-project.example.com.ca') do | ||
it { should_not exist } | ||
end | ||
|
||
describe file('/etc/apache2/ssl/other-project.example.com.dhparams.pem') do | ||
it { should_not exist } | ||
end | ||
|
||
describe file('/etc/apache2/sites-enabled/other_project.conf') do | ||
it { should be_symlink } | ||
end | ||
|
||
describe file('/etc/apache2/sites-available/other_project.conf') do | ||
its(:content) { should include '<Proxy balancer://unicorn_other_project_example_com>' } | ||
its(:content) { should include 'SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH' } | ||
its(:content) { should include 'DocumentRoot /srv/www/other_project/current/public' } | ||
end | ||
end | ||
|
||
context 'appserver' do | ||
describe file('/srv/www/other_project/shared/config/unicorn.conf') do | ||
its(:content) { should include ':backlog => 1024' } | ||
its(:content) { should include ':tries => 5' } | ||
its(:content) { should include 'listen "127.0.0.1:3000"' } | ||
end | ||
|
||
describe file('/srv/www/other_project/shared/scripts/unicorn.service') do | ||
its(:content) { should include 'ENV[\'ENV_VAR1\'] = "test"' } | ||
its(:content) { should include 'ENV[\'HOME\'] = "/home/deploy"' } | ||
its(:content) { should include 'ENV[\'USER\'] = "deploy"' } | ||
its(:content) { should include 'PID_PATH="/srv/www/other_project/shared/pids/unicorn.pid"' } | ||
its(:content) { should include 'def unicorn_running?' } | ||
end | ||
end | ||
|
||
context 'framework' do | ||
describe file('/etc/logrotate.d/other_project-rails-production') do | ||
its(:content) { should include '"/srv/www/other_project/shared/log/*.log" {' } | ||
its(:content) { should include ' daily' } | ||
its(:content) { should include ' rotate 30' } | ||
its(:content) { should include ' missingok' } | ||
its(:content) { should include ' compress' } | ||
its(:content) { should include ' delaycompress' } | ||
its(:content) { should include ' notifempty' } | ||
its(:content) { should include ' copytruncate' } | ||
its(:content) { should include ' sharedscripts' } | ||
end | ||
|
||
describe file('/srv/www/other_project/shared/config/.env.production') do | ||
it { should_not exist } | ||
end | ||
end | ||
end | ||
|
||
describe 'opsworks_ruby::deploy' do | ||
context 'scm' do | ||
describe file('/tmp/ssh-git-wrapper.sh') do | ||
its(:content) { should include 'exec ssh -o UserKnownHostsFile=/dev/null' } | ||
end | ||
|
||
describe file('/srv/www/other_project/current/.git') do | ||
it { should_not exist } | ||
end | ||
end | ||
|
||
context 'webserver' do | ||
describe service('apache2') do | ||
it { should be_running } | ||
end | ||
end | ||
|
||
context 'appserver' do | ||
describe command('pgrep -f unicorn | tr \'\n\' \' \'') do | ||
its(:stdout) { should match(/(?:[0-9]+ ){2}/) } | ||
end | ||
end | ||
|
||
context 'framework' do | ||
describe file('/srv/www/other_project/shared/config/database.yml') do | ||
it { should_not exist } | ||
end | ||
|
||
describe file('/srv/www/other_project/current/config/database.yml') do | ||
it { should be_symlink } | ||
end | ||
end | ||
end |