ventriloquist 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rspec +2 -0
  4. data/CHANGELOG.md +3 -0
  5. data/Gemfile +16 -0
  6. data/Gemfile.lock +118 -0
  7. data/Guardfile +5 -0
  8. data/LICENSE.txt +1 -1
  9. data/README.md +191 -9
  10. data/Rakefile +2 -0
  11. data/development/Vagrantfile +50 -0
  12. data/lib/ventriloquist/cap/debian/git_install.rb +18 -0
  13. data/lib/ventriloquist/cap/debian/go_install.rb +34 -0
  14. data/lib/ventriloquist/cap/debian/install_build_tools.rb +18 -0
  15. data/lib/ventriloquist/cap/debian/mercurial_install.rb +18 -0
  16. data/lib/ventriloquist/cap/debian/mysql_install_client.rb +18 -0
  17. data/lib/ventriloquist/cap/debian/mysql_install_headers.rb +18 -0
  18. data/lib/ventriloquist/cap/debian/nodejs_install.rb +21 -0
  19. data/lib/ventriloquist/cap/debian/pg_install_client.rb +18 -0
  20. data/lib/ventriloquist/cap/debian/pg_install_headers.rb +18 -0
  21. data/lib/ventriloquist/cap/debian/phantomjs_install.rb +24 -0
  22. data/lib/ventriloquist/cap/debian/ventriloquist_containers_upstart.rb +33 -0
  23. data/lib/ventriloquist/cap/linux/download.rb +26 -0
  24. data/lib/ventriloquist/cap/linux/make.rb +14 -0
  25. data/lib/ventriloquist/cap/linux/mysql_configure_client.rb +18 -0
  26. data/lib/ventriloquist/cap/linux/pg_export_pghost.rb +18 -0
  27. data/lib/ventriloquist/cap/linux/rvm_install.rb +17 -0
  28. data/lib/ventriloquist/cap/linux/rvm_install_ruby.rb +18 -0
  29. data/lib/ventriloquist/cap/linux/untar.rb +14 -0
  30. data/lib/ventriloquist/config.rb +12 -0
  31. data/lib/ventriloquist/errors.rb +8 -0
  32. data/lib/ventriloquist/platform.rb +11 -0
  33. data/lib/ventriloquist/platforms/go.rb +13 -0
  34. data/lib/ventriloquist/platforms/nodejs.rb +11 -0
  35. data/lib/ventriloquist/platforms/phantomjs.rb +12 -0
  36. data/lib/ventriloquist/platforms/ruby.rb +15 -0
  37. data/lib/ventriloquist/platforms_builder.rb +56 -0
  38. data/lib/ventriloquist/plugin.rb +119 -0
  39. data/lib/ventriloquist/provisioner.rb +59 -0
  40. data/lib/ventriloquist/service.rb +23 -0
  41. data/lib/ventriloquist/services/mysql.rb +39 -0
  42. data/lib/ventriloquist/services/postgresql.rb +39 -0
  43. data/lib/ventriloquist/services/redis.rb +31 -0
  44. data/lib/ventriloquist/services_builder.rb +66 -0
  45. data/lib/ventriloquist/version.rb +4 -2
  46. data/lib/ventriloquist.rb +1 -5
  47. data/locales/en.yml +1 -0
  48. data/services/base/Dockerfile +15 -0
  49. data/services/build-all.sh +20 -0
  50. data/services/elasticsearch/Dockerfile +12 -0
  51. data/services/memcached/Dockerfile +17 -0
  52. data/services/mysql/Dockerfile +20 -0
  53. data/services/mysql/config/bin/add-mysql-user +19 -0
  54. data/services/openjdk7/Dockerfile +9 -0
  55. data/services/postgresql/9.1/Dockerfile +20 -0
  56. data/services/postgresql/9.1/config/bin/prepare-postgres +27 -0
  57. data/services/postgresql/9.1/config/bin/start-postgres +6 -0
  58. data/services/postgresql/9.1/config/etc/postgresql/9.1/main/pg_hba.conf +3 -0
  59. data/services/postgresql/9.2/Dockerfile +15 -0
  60. data/services/postgresql/9.2/config/bin/prepare-postgres +25 -0
  61. data/services/postgresql/9.2/config/bin/start-postgres +6 -0
  62. data/services/postgresql/9.2/config/etc/postgresql/9.2/main/postgresql.conf +573 -0
  63. data/services/redis/Dockerfile +11 -0
  64. data/spec/spec_helper.rb +26 -0
  65. data/spec/unit/platforms_builder_spec.rb +50 -0
  66. data/spec/unit/service_spec.rb +38 -0
  67. data/spec/unit/services_builder_spec.rb +54 -0
  68. data/tasks/spec.rake +9 -0
  69. data/ventriloquist.gemspec +16 -13
  70. metadata +88 -9
@@ -0,0 +1,54 @@
1
+ require 'spec_helper'
2
+
3
+ require 'vocker/docker_client'
4
+ require 'ventriloquist/services_builder'
5
+
6
+ describe VagrantPlugins::Ventriloquist::ServicesBuilder do
7
+ Service = VagrantPlugins::Ventriloquist::Service
8
+
9
+ verify_contract(:services_builder)
10
+
11
+ fake(:docker_client)
12
+
13
+ let(:pg_cfg) { {image: 'user/pg', tag: '9.2'} }
14
+ let(:svcs_configs) { [{pg: pg_cfg}, ['some-service'], 'mysql:1.2'] }
15
+ let(:custom_mapping) { {'mysql' => custom_service} }
16
+ let(:custom_service) { Class.new(Service) }
17
+
18
+ let(:services) { described_class.new(svcs_configs, custom_mapping).build(docker_client) }
19
+ let(:pg) { services[0] }
20
+ let(:other) { services[1] }
21
+ let(:mysql) { services[2] }
22
+
23
+ it 'builds a list of service objects' do
24
+ expect(services).to have(3).items
25
+ expect(pg).to be_a(Service)
26
+ expect(other).to be_a(Service)
27
+ expect(mysql).to be_a(custom_service)
28
+ end
29
+
30
+ it 'sets the docker client for services' do
31
+ expect(pg.docker_client).to eq(docker_client)
32
+ end
33
+
34
+ it 'configures services using defined configs' do
35
+ expect(pg.config).to eq(pg_cfg)
36
+ end
37
+
38
+ it 'extracts tag from image name' do
39
+ expect(mysql.config[:tag]).to eq('1.2')
40
+ end
41
+
42
+ it 'defaults tag to "latest"' do
43
+ expect(other.config[:tag]).to eq('latest')
44
+ end
45
+
46
+ it 'prepends "fgrehm/ventriloquist-" to image names if image config is not provided' do
47
+ expect(mysql.config[:image]).to eq('fgrehm/ventriloquist-mysql:1.2')
48
+ end
49
+
50
+ it 'sets the service name' do
51
+ expect(pg.name).to eq('pg')
52
+ expect(mysql.name).to eq('mysql')
53
+ end
54
+ end
data/tasks/spec.rake ADDED
@@ -0,0 +1,9 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec::Core::RakeTask.new do |t|
4
+ ENV['COVERAGE'] = 'true'
5
+ t.pattern = "./spec/**/*_spec.rb"
6
+ end
7
+
8
+ desc 'Default task which runs all specs with code coverage enabled'
9
+ task :default => ['spec']
@@ -1,19 +1,22 @@
1
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'ventriloquist/version'
5
5
 
6
- Gem::Specification.new do |gem|
7
- gem.name = "ventriloquist"
8
- gem.version = Ventriloquist::VERSION
9
- gem.authors = ["Fabio Rehm"]
10
- gem.email = ["fgrehm@gmail.com"]
11
- gem.description = %q{Coming out soon...}
12
- gem.summary = gem.description
13
- gem.homepage = "" # https://github.com/fgrehm/ventriloquist
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ventriloquist"
8
+ spec.version = VagrantPlugins::Ventriloquist::VERSION
9
+ spec.authors = ["Fabio Rehm"]
10
+ spec.email = ["fgrehm@gmail.com"]
11
+ spec.description = %q{Vagrant development environments made easy}
12
+ spec.summary = spec.description
13
+ spec.homepage = "https://github.com/fgrehm/ventriloquist"
14
+ spec.license = "MIT"
14
15
 
15
- gem.files = `git ls-files`.split($/)
16
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
- gem.require_paths = ["lib"]
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'vocker', '~> 0.3.0'
19
22
  end
metadata CHANGED
@@ -1,16 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ventriloquist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Rehm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-21 00:00:00.000000000 Z
12
- dependencies: []
13
- description: Coming out soon...
11
+ date: 2013-09-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: vocker
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 0.3.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.3.0
27
+ description: Vagrant development environments made easy
14
28
  email:
15
29
  - fgrehm@gmail.com
16
30
  executables: []
@@ -18,15 +32,76 @@ extensions: []
18
32
  extra_rdoc_files: []
19
33
  files:
20
34
  - .gitignore
35
+ - .rspec
36
+ - CHANGELOG.md
21
37
  - Gemfile
38
+ - Gemfile.lock
39
+ - Guardfile
22
40
  - LICENSE.txt
23
41
  - README.md
24
42
  - Rakefile
43
+ - development/Vagrantfile
25
44
  - lib/ventriloquist.rb
45
+ - lib/ventriloquist/cap/debian/git_install.rb
46
+ - lib/ventriloquist/cap/debian/go_install.rb
47
+ - lib/ventriloquist/cap/debian/install_build_tools.rb
48
+ - lib/ventriloquist/cap/debian/mercurial_install.rb
49
+ - lib/ventriloquist/cap/debian/mysql_install_client.rb
50
+ - lib/ventriloquist/cap/debian/mysql_install_headers.rb
51
+ - lib/ventriloquist/cap/debian/nodejs_install.rb
52
+ - lib/ventriloquist/cap/debian/pg_install_client.rb
53
+ - lib/ventriloquist/cap/debian/pg_install_headers.rb
54
+ - lib/ventriloquist/cap/debian/phantomjs_install.rb
55
+ - lib/ventriloquist/cap/debian/ventriloquist_containers_upstart.rb
56
+ - lib/ventriloquist/cap/linux/download.rb
57
+ - lib/ventriloquist/cap/linux/make.rb
58
+ - lib/ventriloquist/cap/linux/mysql_configure_client.rb
59
+ - lib/ventriloquist/cap/linux/pg_export_pghost.rb
60
+ - lib/ventriloquist/cap/linux/rvm_install.rb
61
+ - lib/ventriloquist/cap/linux/rvm_install_ruby.rb
62
+ - lib/ventriloquist/cap/linux/untar.rb
63
+ - lib/ventriloquist/config.rb
64
+ - lib/ventriloquist/errors.rb
65
+ - lib/ventriloquist/platform.rb
66
+ - lib/ventriloquist/platforms/go.rb
67
+ - lib/ventriloquist/platforms/nodejs.rb
68
+ - lib/ventriloquist/platforms/phantomjs.rb
69
+ - lib/ventriloquist/platforms/ruby.rb
70
+ - lib/ventriloquist/platforms_builder.rb
71
+ - lib/ventriloquist/plugin.rb
72
+ - lib/ventriloquist/provisioner.rb
73
+ - lib/ventriloquist/service.rb
74
+ - lib/ventriloquist/services/mysql.rb
75
+ - lib/ventriloquist/services/postgresql.rb
76
+ - lib/ventriloquist/services/redis.rb
77
+ - lib/ventriloquist/services_builder.rb
26
78
  - lib/ventriloquist/version.rb
79
+ - locales/en.yml
80
+ - services/base/Dockerfile
81
+ - services/build-all.sh
82
+ - services/elasticsearch/Dockerfile
83
+ - services/memcached/Dockerfile
84
+ - services/mysql/Dockerfile
85
+ - services/mysql/config/bin/add-mysql-user
86
+ - services/openjdk7/Dockerfile
87
+ - services/postgresql/9.1/Dockerfile
88
+ - services/postgresql/9.1/config/bin/prepare-postgres
89
+ - services/postgresql/9.1/config/bin/start-postgres
90
+ - services/postgresql/9.1/config/etc/postgresql/9.1/main/pg_hba.conf
91
+ - services/postgresql/9.2/Dockerfile
92
+ - services/postgresql/9.2/config/bin/prepare-postgres
93
+ - services/postgresql/9.2/config/bin/start-postgres
94
+ - services/postgresql/9.2/config/etc/postgresql/9.2/main/postgresql.conf
95
+ - services/redis/Dockerfile
96
+ - spec/spec_helper.rb
97
+ - spec/unit/platforms_builder_spec.rb
98
+ - spec/unit/service_spec.rb
99
+ - spec/unit/services_builder_spec.rb
100
+ - tasks/spec.rake
27
101
  - ventriloquist.gemspec
28
- homepage: ''
29
- licenses: []
102
+ homepage: https://github.com/fgrehm/ventriloquist
103
+ licenses:
104
+ - MIT
30
105
  metadata: {}
31
106
  post_install_message:
32
107
  rdoc_options: []
@@ -44,8 +119,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
119
  version: '0'
45
120
  requirements: []
46
121
  rubyforge_project:
47
- rubygems_version: 2.0.0
122
+ rubygems_version: 2.0.7
48
123
  signing_key:
49
124
  specification_version: 4
50
- summary: Coming out soon...
51
- test_files: []
125
+ summary: Vagrant development environments made easy
126
+ test_files:
127
+ - spec/spec_helper.rb
128
+ - spec/unit/platforms_builder_spec.rb
129
+ - spec/unit/service_spec.rb
130
+ - spec/unit/services_builder_spec.rb