This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #9 from codenamephp/dev
[RELEASE 1.0.0]
- Loading branch information
Showing
18 changed files
with
298 additions
and
43 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,21 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Rake documentation:changelog", | ||
"type": "Ruby", | ||
"request": "launch", | ||
"cwd": "${workspaceRoot}", | ||
"program": "${workspaceRoot}/vendor/rake", | ||
"showDebuggerOutput": true, | ||
"stopOnEntry": true, | ||
"useBundler": true, | ||
"args": [ | ||
"documentation:changelog" | ||
] | ||
} | ||
] | ||
} |
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,24 @@ | ||
# | ||
# Cookbook:: . | ||
# Recipe:: 5.6 | ||
# | ||
# Copyright:: 2018, The Authors, All Rights Reserved. | ||
|
||
apt_repository 'oracle mysql' do | ||
uri 'http://repo.mysql.com/apt/debian' | ||
repo_name 'oracle-mysql' | ||
components ['mysql-apt-config', 'mysql-5.6', 'mysql-tools'] | ||
keyserver 'pgp.mit.edu' | ||
key '5072E1F5' | ||
deb_src true | ||
end | ||
|
||
package 'mysql-server' | ||
package 'mysql-client' | ||
|
||
service 'mysql' do | ||
action %i[start enable] | ||
end | ||
|
||
include_recipe '::service' | ||
include_recipe '::innodb_file_per_table' |
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,15 @@ | ||
# | ||
# Cookbook:: . | ||
# Recipe:: innodb_file_per_table | ||
# | ||
# Copyright:: 2018, The Authors, All Rights Reserved. | ||
|
||
include_recipe '::service' | ||
|
||
template '/etc/mysql/conf.d/50-innodb.cnf' do | ||
source 'innodb.erb' | ||
owner 'root' | ||
group 'root' | ||
action :create | ||
notifies :restart, 'service[mysql]', :immediately | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# Cookbook:: . | ||
# Recipe:: 5.6 | ||
# | ||
# Copyright:: 2018, The Authors, All Rights Reserved. | ||
|
||
service 'mysql' do | ||
action %i[start enable] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# Cookbook:: codenamephp_mysql | ||
# Spec:: 5.6 | ||
# | ||
# Copyright:: 2018, The Authors, All Rights Reserved. | ||
|
||
require 'spec_helper' | ||
|
||
describe 'codenamephp_mysql::5.6' do | ||
context 'When all attributes are default' do | ||
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) } | ||
let(:template) { chef_run.template('/etc/mysql/conf.d/50-innodb.cnf') } | ||
|
||
it 'converges successfully' do | ||
expect { chef_run }.to_not raise_error | ||
end | ||
|
||
it 'adds the apt repo' do | ||
expect(chef_run).to add_apt_repository('oracle mysql') | ||
end | ||
|
||
it 'installs mysql-server from package' do | ||
expect(chef_run).to install_package('mysql-server') | ||
end | ||
|
||
it 'installs mysql-client from package' do | ||
expect(chef_run).to install_package('mysql-client') | ||
end | ||
|
||
it 'includes the service recipe' do | ||
expect(chef_run).to include_recipe('codenamephp_mysql::service') | ||
end | ||
|
||
it 'includes the innodb_file_per_table recipe' do | ||
expect(chef_run).to include_recipe('codenamephp_mysql::innodb_file_per_table') | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Cookbook:: . | ||
# Spec:: innodb_file_per_table | ||
# | ||
# Copyright:: 2018, The Authors, All Rights Reserved. | ||
|
||
require 'spec_helper' | ||
|
||
describe 'codenamephp_mysql::innodb_file_per_table' do | ||
context 'When all attributes are default' do | ||
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) } | ||
let(:template) { chef_run.template('/etc/mysql/conf.d/50-innodb.cnf') } | ||
|
||
it 'includes the service recipe' do | ||
expect(chef_run).to include_recipe('codenamephp_mysql::service') | ||
end | ||
|
||
it 'adds innodb config template and restarts mysql service immediately' do | ||
expect(chef_run).to create_template('/etc/mysql/conf.d/50-innodb.cnf').with( | ||
source: 'innodb.erb', | ||
user: 'root', | ||
group: 'root' | ||
) | ||
expect(template).to notify('service[mysql]').to(:restart).immediately | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# Cookbook:: codenamephp_mysql | ||
# Spec:: default | ||
# | ||
# Copyright:: 2017, The Authors, All Rights Reserved. | ||
|
||
require 'spec_helper' | ||
|
||
describe 'codenamephp_mysql::service' do | ||
context 'When all attributes are default' do | ||
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) } | ||
|
||
it 'converges successfully' do | ||
expect { chef_run }.to_not raise_error | ||
end | ||
|
||
it 'makes sure the service is started and enabled' do | ||
expect(chef_run).to enable_service('mysql') | ||
expect(chef_run).to start_service('mysql') | ||
end | ||
end | ||
end |
Oops, something went wrong.