boxci 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.ruby-version +1 -0
  4. data/CHANGELOG.md +146 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +118 -0
  8. data/Rakefile +13 -0
  9. data/bin/boxci +6 -0
  10. data/boxci.gemspec +28 -0
  11. data/lib/boxci/builder.rb +29 -0
  12. data/lib/boxci/cli.rb +70 -0
  13. data/lib/boxci/config_permutation.rb +15 -0
  14. data/lib/boxci/config_permutation_component.rb +11 -0
  15. data/lib/boxci/config_permutation_component_factory.rb +7 -0
  16. data/lib/boxci/config_permutation_components/rbenv.rb +13 -0
  17. data/lib/boxci/dependency_checker.rb +55 -0
  18. data/lib/boxci/global_config.rb +26 -0
  19. data/lib/boxci/initializer.rb +41 -0
  20. data/lib/boxci/language.rb +35 -0
  21. data/lib/boxci/language_factory.rb +7 -0
  22. data/lib/boxci/languages/ruby.rb +31 -0
  23. data/lib/boxci/project_config.rb +96 -0
  24. data/lib/boxci/provider.rb +35 -0
  25. data/lib/boxci/provider_config.rb +23 -0
  26. data/lib/boxci/provider_factory.rb +7 -0
  27. data/lib/boxci/providers/aws.rb +27 -0
  28. data/lib/boxci/providers/openstack.rb +27 -0
  29. data/lib/boxci/providers/virtualbox.rb +24 -0
  30. data/lib/boxci/templates/Vagrantfile +41 -0
  31. data/lib/boxci/templates/boxci/global_config.yml.tt +1 -0
  32. data/lib/boxci/templates/dot_boxci.yml.tt +11 -0
  33. data/lib/boxci/templates/languages/ruby/main.pp +27 -0
  34. data/lib/boxci/templates/providers/aws/Vagrantfile.erb +45 -0
  35. data/lib/boxci/templates/providers/aws.yml.tt +5 -0
  36. data/lib/boxci/templates/providers/openstack/Vagrantfile.erb +37 -0
  37. data/lib/boxci/templates/providers/openstack.yml.tt +16 -0
  38. data/lib/boxci/templates/providers/virtualbox/Vagrantfile.erb +47 -0
  39. data/lib/boxci/templates/providers/virtualbox.yml.tt +2 -0
  40. data/lib/boxci/templates/puppet/manifests/.empty_directory +0 -0
  41. data/lib/boxci/templates/puppet/modules/.empty_directory +0 -0
  42. data/lib/boxci/test_runner.rb +134 -0
  43. data/lib/boxci/tester.rb +287 -0
  44. data/lib/boxci/version.rb +3 -0
  45. data/lib/boxci.rb +71 -0
  46. data/spec/lib/boxci/builder_spec.rb +86 -0
  47. data/spec/lib/boxci/config_permutation_component_factory_spec.rb +17 -0
  48. data/spec/lib/boxci/config_permutation_component_spec.rb +19 -0
  49. data/spec/lib/boxci/config_permutation_components/rbenv_spec.rb +12 -0
  50. data/spec/lib/boxci/config_permutation_spec.rb +27 -0
  51. data/spec/lib/boxci/dependency_checker_spec.rb +215 -0
  52. data/spec/lib/boxci/global_config_spec.rb +34 -0
  53. data/spec/lib/boxci/initializer_spec.rb +117 -0
  54. data/spec/lib/boxci/language_factory_spec.rb +17 -0
  55. data/spec/lib/boxci/language_spec.rb +31 -0
  56. data/spec/lib/boxci/project_config_spec.rb +218 -0
  57. data/spec/lib/boxci/provider_config_spec.rb +39 -0
  58. data/spec/lib/boxci/provider_factory_spec.rb +17 -0
  59. data/spec/lib/boxci/provider_spec.rb +30 -0
  60. data/spec/lib/boxci/tester_spec.rb +15 -0
  61. data/spec/lib/boxci_spec.rb +176 -0
  62. data/spec/spec_helper.rb +11 -0
  63. metadata +213 -0
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ class Boxci::Provider::TestPureVirtualProviderVagrantTwo < ::Boxci::Provider
4
+ end
5
+
6
+ describe Boxci::Provider do
7
+ describe "#generate_provider_vagrantfile" do
8
+ it "raises an exception when not implemented by subclass" do
9
+ expect { Boxci::Provider::TestPureVirtualProviderVagrantTwo.new.generate_provider_vagrantfile }.to raise_error(Boxci::PureVirtualMethod)
10
+ end
11
+ end
12
+
13
+ describe "#requires_plugin?" do
14
+ it "raises an exception when not implemented by subclass" do
15
+ expect { Boxci::Provider::TestPureVirtualProviderVagrantTwo.new.requires_plugin? }.to raise_error(Boxci::PureVirtualMethod)
16
+ end
17
+ end
18
+
19
+ describe "#plugin" do
20
+ it "raises an exception when not implemented by subclass" do
21
+ expect { Boxci::Provider::TestPureVirtualProviderVagrantTwo.new.plugin }.to raise_error(Boxci::PureVirtualMethod)
22
+ end
23
+ end
24
+
25
+ describe "#dummy_box_url" do
26
+ it "raises an exception when not implemented by subclass" do
27
+ expect { Boxci::Provider::TestPureVirtualProviderVagrantTwo.new.dummy_box_url }.to raise_error(Boxci::PureVirtualMethod)
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,15 @@
1
+ require "spec_helper"
2
+
3
+ describe Boxci::Tester do
4
+ describe "#test" do
5
+ before do
6
+ allow(Boxci::DependencyChecker).to receive(:verify_all)
7
+ allow(Boxci::DependencyChecker).to receive(:create_base_files)
8
+ end
9
+
10
+ it "verifies all required dependencies are installed" do
11
+ # expect(Boxci::DependencyChecker).to receive(:verify_all)
12
+ # subject.test
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,176 @@
1
+ require 'spec_helper'
2
+
3
+ describe Boxci do
4
+ describe ".project_config" do
5
+ context "when a boxci project config instance has already been cached" do
6
+ it "returns the cached project config instance" do
7
+ project_config_double = double
8
+ subject.instance_variable_set(:@project_config, project_config_double)
9
+ expect(subject.project_config).to eq(project_config_double)
10
+ end
11
+ end
12
+
13
+ context "when a boxci project config instance has NOT been cached" do
14
+ before do
15
+ subject.instance_variable_set(:@project_config, nil)
16
+ end
17
+
18
+ it "constructs a project config instance" do
19
+ expect(Boxci::ProjectConfig).to receive(:new).and_return(double(:load => nil))
20
+ subject.project_config
21
+ end
22
+
23
+ it "caches the project config instance in an instance variable" do
24
+ project_config_double = double(:load => nil)
25
+ allow(Boxci::ProjectConfig).to receive(:new).and_return(project_config_double)
26
+ subject.project_config
27
+ expect(subject.instance_variable_get(:@project_config)).to eq(project_config_double)
28
+ end
29
+
30
+ it "loads the project config" do
31
+ project_config_double = double
32
+ allow(Boxci::ProjectConfig).to receive(:new).and_return(project_config_double)
33
+ expect(project_config_double).to receive(:load)
34
+ subject.project_config
35
+ end
36
+
37
+ it "returns the cached project config instance" do
38
+ project_config_double = double(:load => nil)
39
+ allow(Boxci::ProjectConfig).to receive(:new).and_return(project_config_double)
40
+ expect(subject.project_config).to eq(project_config_double)
41
+ end
42
+ end
43
+ end
44
+
45
+ describe ".global_config" do
46
+ context "when provider config instance has already been cached" do
47
+ it "returns the cached provider config instance" do
48
+ global_config_double = double
49
+ subject.instance_variable_set(:@global_config, global_config_double)
50
+ expect(subject.global_config).to eq(global_config_double)
51
+ end
52
+ end
53
+
54
+ context "when provider config instance has NOT been cached" do
55
+ before do
56
+ subject.instance_variable_set(:@global_config, nil)
57
+ end
58
+
59
+ it "constructs a provider config instance" do
60
+ expect(Boxci::GlobalConfig).to receive(:new).and_return(double(:load => nil))
61
+ subject.global_config
62
+ end
63
+
64
+ it "caches the provider config instance in an instance variable" do
65
+ global_config_double = double(:load => nil)
66
+ allow(Boxci::GlobalConfig).to receive(:new).and_return(global_config_double)
67
+ subject.global_config
68
+ expect(subject.instance_variable_get(:@global_config)).to eq(global_config_double)
69
+ end
70
+
71
+ it "loads the project config" do
72
+ global_config_double = double
73
+ allow(Boxci::GlobalConfig).to receive(:new).and_return(global_config_double)
74
+ expect(global_config_double).to receive(:load)
75
+ subject.global_config
76
+ end
77
+
78
+ it "returns the cached project config instance" do
79
+ global_config_double = double(:load => nil)
80
+ allow(Boxci::GlobalConfig).to receive(:new).and_return(global_config_double)
81
+ expect(subject.global_config).to eq(global_config_double)
82
+ end
83
+ end
84
+ end
85
+
86
+ describe ".provider_config" do
87
+ context "when the provider config instance has already been cached" do
88
+ it "returns the cached provider config instance" do
89
+ provider_config_double = double("provider config")
90
+ subject.instance_variable_set(:@provider_config, provider_config_double)
91
+ expect(subject.provider_config('aws')).to eq(provider_config_double)
92
+ end
93
+ end
94
+
95
+ context "when the provider config instance has NOT been cached" do
96
+ before do
97
+ subject.instance_variable_set(:@provider_config, nil)
98
+ end
99
+
100
+ it "constructs a provider config instance" do
101
+ expect(Boxci::ProviderConfig).to receive(:new).and_return(double(:load => nil))
102
+ subject.provider_config('aws')
103
+ end
104
+
105
+ it "caches the provider config instance in an instance variable" do
106
+ provider_config_double = double(:load => nil)
107
+ allow(Boxci::ProviderConfig).to receive(:new).and_return(provider_config_double)
108
+ subject.provider_config('aws')
109
+ expect(subject.instance_variable_get(:@provider_config)).to eq(provider_config_double)
110
+ end
111
+
112
+ it "loads the provider config" do
113
+ provider_config_double = double
114
+ allow(Boxci::ProviderConfig).to receive(:new).and_return(provider_config_double)
115
+ expect(provider_config_double).to receive(:load)
116
+ subject.provider_config('aws')
117
+ end
118
+
119
+ it "returns the cached provider config instance" do
120
+ provider_config_double = double(:load => nil)
121
+ allow(Boxci::ProviderConfig).to receive(:new).and_return(provider_config_double)
122
+ expect(subject.provider_config('aws')).to eq(provider_config_double)
123
+ end
124
+ end
125
+ end
126
+
127
+ describe ".default_provider" do
128
+ context "when has a default provider" do
129
+ before do
130
+ allow(subject).to receive(:global_config).and_return(double(:default_provider => 'foo'))
131
+ end
132
+
133
+ it "returns the default provider" do
134
+ expect(subject.default_provider).to eq('foo')
135
+ end
136
+ end
137
+
138
+ context "when it does NOT have a default provider" do
139
+ before do
140
+ allow(subject).to receive(:global_config).and_return(double(:default_provider => nil))
141
+ end
142
+
143
+ it "returns boxci hard coded default provider" do
144
+ expect(subject.default_provider).to eq(::Boxci::CLI::DEFAULT_PROVIDER)
145
+ end
146
+ end
147
+ end
148
+
149
+ describe ".project_path" do
150
+ context "when the value is already set" do
151
+ before do
152
+ subject.instance_variable_set(:@project_path, "abc")
153
+ end
154
+
155
+ it "returns it" do
156
+ expect(subject.project_path).to eq("abc")
157
+ end
158
+ end
159
+
160
+ context "when the value is not set" do
161
+ before do
162
+ subject.instance_variable_set(:@project_path, nil)
163
+ allow(File).to receive(:expand_path).and_return("/some/path")
164
+ end
165
+
166
+ it "gets the project path" do
167
+ expect(File).to receive(:expand_path).and_return("/some/path")
168
+ subject.project_path
169
+ end
170
+
171
+ it "sets the result to the instance variable" do
172
+ expect(subject.project_path).to eq("/some/path")
173
+ end
174
+ end
175
+ end
176
+ end
@@ -0,0 +1,11 @@
1
+ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
2
+
3
+ require 'boxci'
4
+
5
+ RSpec.configure do |config|
6
+ # Run specs in random order to surface order dependencies. If you find an
7
+ # order dependency and want to debug it, you can fix the order by providing
8
+ # the seed, which is printed after each run.
9
+ # --seed 1234
10
+ config.order = "random"
11
+ end
metadata ADDED
@@ -0,0 +1,213 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: boxci
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.30
5
+ platform: ruby
6
+ authors:
7
+ - Andrew De Ponte
8
+ - Brian Miller
9
+ - Russell Cloak
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2014-03-21 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: thor
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '0.18'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '0.18'
29
+ - !ruby/object:Gem::Dependency
30
+ name: net-ssh
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '2.7'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '2.7'
43
+ - !ruby/object:Gem::Dependency
44
+ name: net-scp
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.1'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '1.1'
57
+ - !ruby/object:Gem::Dependency
58
+ name: bundler
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '1.5'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '1.5'
71
+ - !ruby/object:Gem::Dependency
72
+ name: rspec
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '2.14'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: '2.14'
85
+ - !ruby/object:Gem::Dependency
86
+ name: rake
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '10.1'
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - "~>"
97
+ - !ruby/object:Gem::Version
98
+ version: '10.1'
99
+ description: Boxci is focused on defining standards and building tooling around using
100
+ Vagrant for development & continuous integration environments to make using them
101
+ as easy as possible.
102
+ email:
103
+ - cyphactor@gmail.com
104
+ - brimil01@gmail.com
105
+ - russcloak@gmail.cm
106
+ executables:
107
+ - boxci
108
+ extensions: []
109
+ extra_rdoc_files: []
110
+ files:
111
+ - ".gitignore"
112
+ - ".ruby-version"
113
+ - CHANGELOG.md
114
+ - Gemfile
115
+ - LICENSE.txt
116
+ - README.md
117
+ - Rakefile
118
+ - bin/boxci
119
+ - boxci.gemspec
120
+ - lib/boxci.rb
121
+ - lib/boxci/builder.rb
122
+ - lib/boxci/cli.rb
123
+ - lib/boxci/config_permutation.rb
124
+ - lib/boxci/config_permutation_component.rb
125
+ - lib/boxci/config_permutation_component_factory.rb
126
+ - lib/boxci/config_permutation_components/rbenv.rb
127
+ - lib/boxci/dependency_checker.rb
128
+ - lib/boxci/global_config.rb
129
+ - lib/boxci/initializer.rb
130
+ - lib/boxci/language.rb
131
+ - lib/boxci/language_factory.rb
132
+ - lib/boxci/languages/ruby.rb
133
+ - lib/boxci/project_config.rb
134
+ - lib/boxci/provider.rb
135
+ - lib/boxci/provider_config.rb
136
+ - lib/boxci/provider_factory.rb
137
+ - lib/boxci/providers/aws.rb
138
+ - lib/boxci/providers/openstack.rb
139
+ - lib/boxci/providers/virtualbox.rb
140
+ - lib/boxci/templates/Vagrantfile
141
+ - lib/boxci/templates/boxci/global_config.yml.tt
142
+ - lib/boxci/templates/dot_boxci.yml.tt
143
+ - lib/boxci/templates/languages/ruby/main.pp
144
+ - lib/boxci/templates/providers/aws.yml.tt
145
+ - lib/boxci/templates/providers/aws/Vagrantfile.erb
146
+ - lib/boxci/templates/providers/openstack.yml.tt
147
+ - lib/boxci/templates/providers/openstack/Vagrantfile.erb
148
+ - lib/boxci/templates/providers/virtualbox.yml.tt
149
+ - lib/boxci/templates/providers/virtualbox/Vagrantfile.erb
150
+ - lib/boxci/templates/puppet/manifests/.empty_directory
151
+ - lib/boxci/templates/puppet/modules/.empty_directory
152
+ - lib/boxci/test_runner.rb
153
+ - lib/boxci/tester.rb
154
+ - lib/boxci/version.rb
155
+ - spec/lib/boxci/builder_spec.rb
156
+ - spec/lib/boxci/config_permutation_component_factory_spec.rb
157
+ - spec/lib/boxci/config_permutation_component_spec.rb
158
+ - spec/lib/boxci/config_permutation_components/rbenv_spec.rb
159
+ - spec/lib/boxci/config_permutation_spec.rb
160
+ - spec/lib/boxci/dependency_checker_spec.rb
161
+ - spec/lib/boxci/global_config_spec.rb
162
+ - spec/lib/boxci/initializer_spec.rb
163
+ - spec/lib/boxci/language_factory_spec.rb
164
+ - spec/lib/boxci/language_spec.rb
165
+ - spec/lib/boxci/project_config_spec.rb
166
+ - spec/lib/boxci/provider_config_spec.rb
167
+ - spec/lib/boxci/provider_factory_spec.rb
168
+ - spec/lib/boxci/provider_spec.rb
169
+ - spec/lib/boxci/tester_spec.rb
170
+ - spec/lib/boxci_spec.rb
171
+ - spec/spec_helper.rb
172
+ homepage: http://github.com/reachlocal/boxci
173
+ licenses:
174
+ - MIT
175
+ metadata: {}
176
+ post_install_message:
177
+ rdoc_options: []
178
+ require_paths:
179
+ - lib
180
+ required_ruby_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ required_rubygems_version: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ requirements: []
191
+ rubyforge_project:
192
+ rubygems_version: 2.2.0
193
+ signing_key:
194
+ specification_version: 4
195
+ summary: Tool simplifying Vagrant based development & continuous integration environments.
196
+ test_files:
197
+ - spec/lib/boxci/builder_spec.rb
198
+ - spec/lib/boxci/config_permutation_component_factory_spec.rb
199
+ - spec/lib/boxci/config_permutation_component_spec.rb
200
+ - spec/lib/boxci/config_permutation_components/rbenv_spec.rb
201
+ - spec/lib/boxci/config_permutation_spec.rb
202
+ - spec/lib/boxci/dependency_checker_spec.rb
203
+ - spec/lib/boxci/global_config_spec.rb
204
+ - spec/lib/boxci/initializer_spec.rb
205
+ - spec/lib/boxci/language_factory_spec.rb
206
+ - spec/lib/boxci/language_spec.rb
207
+ - spec/lib/boxci/project_config_spec.rb
208
+ - spec/lib/boxci/provider_config_spec.rb
209
+ - spec/lib/boxci/provider_factory_spec.rb
210
+ - spec/lib/boxci/provider_spec.rb
211
+ - spec/lib/boxci/tester_spec.rb
212
+ - spec/lib/boxci_spec.rb
213
+ - spec/spec_helper.rb