polytrix 0.0.1 → 0.1.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -2
  3. data/.rspec +1 -6
  4. data/.rubocop-todo.yml +19 -0
  5. data/.rubocop.yml +10 -0
  6. data/.travis.yml +11 -0
  7. data/Gemfile +0 -16
  8. data/README.md +119 -28
  9. data/Rakefile +18 -123
  10. data/bin/polytrix +5 -0
  11. data/doc-src/_markdown.md +5 -0
  12. data/doc-src/default_bootstrap.md +13 -0
  13. data/docs/influences.md +28 -0
  14. data/docs/samples/code2doc/java/HelloWorld.md +13 -0
  15. data/docs/samples/code2doc/java/Quine.md +33 -0
  16. data/docs/samples/code2doc/python/hello_world.md +3 -0
  17. data/docs/samples/code2doc/python/quine.md +4 -0
  18. data/docs/samples/code2doc/ruby/hello_world.md +7 -0
  19. data/features/execution.feature +67 -0
  20. data/features/fixtures/configs/empty.yml +12 -0
  21. data/features/fixtures/configs/hello_world.yml +10 -0
  22. data/features/fixtures/spec/polytrix_merge.rb +5 -0
  23. data/features/fixtures/spec/polytrix_spec.rb +10 -0
  24. data/features/reporting.feature +140 -0
  25. data/features/step_definitions/sdk_steps.rb +12 -0
  26. data/features/support/env.rb +8 -0
  27. data/lib/polytrix/challenge.rb +20 -7
  28. data/lib/polytrix/challenge_runner.rb +9 -44
  29. data/lib/polytrix/cli/add.rb +67 -0
  30. data/lib/polytrix/cli/report.rb +88 -0
  31. data/lib/polytrix/cli/reports/hash_reporter.rb +30 -0
  32. data/lib/polytrix/cli/reports/json_reporter.rb +14 -0
  33. data/lib/polytrix/cli/reports/markdown_reporter.rb +23 -0
  34. data/lib/polytrix/cli/reports/yaml_reporter.rb +14 -0
  35. data/lib/polytrix/cli.rb +158 -0
  36. data/lib/polytrix/configuration.rb +65 -4
  37. data/lib/polytrix/core/file_system_helper.rb +75 -0
  38. data/lib/polytrix/core/implementor.rb +31 -3
  39. data/lib/polytrix/documentation/code_segmenter.rb +168 -0
  40. data/lib/polytrix/documentation/comment_styles.rb +87 -0
  41. data/lib/polytrix/documentation/helpers/code_helper.rb +85 -0
  42. data/lib/polytrix/documentation/view_helper.rb +21 -0
  43. data/lib/polytrix/documentation_generator.rb +59 -10
  44. data/lib/polytrix/executor.rb +89 -0
  45. data/lib/polytrix/logger.rb +17 -0
  46. data/lib/polytrix/manifest.rb +64 -7
  47. data/lib/polytrix/result.rb +16 -2
  48. data/lib/polytrix/rspec/documentation_formatter.rb +41 -16
  49. data/lib/polytrix/rspec/yaml_report.rb +51 -0
  50. data/lib/polytrix/rspec.rb +32 -53
  51. data/lib/polytrix/runners/middleware/feature_executor.rb +4 -3
  52. data/lib/polytrix/runners/middleware/setup_env_vars.rb +6 -4
  53. data/lib/polytrix/validation.rb +20 -0
  54. data/lib/polytrix/validations.rb +23 -0
  55. data/lib/polytrix/validator.rb +20 -0
  56. data/lib/polytrix/validator_registry.rb +34 -0
  57. data/lib/polytrix/version.rb +1 -1
  58. data/lib/polytrix.rb +125 -22
  59. data/polytrix.gemspec +7 -2
  60. data/polytrix.rb +6 -0
  61. data/polytrix_tests.yml +20 -0
  62. data/resources/code_sample.tt +2 -0
  63. data/samples/.gitignore +2 -0
  64. data/samples/_markdown.md +5 -0
  65. data/samples/default_bootstrap.rb +14 -0
  66. data/samples/polytrix.rb +28 -0
  67. data/samples/polytrix_cli.sh +7 -0
  68. data/samples/polytrix_tests.yml +10 -0
  69. data/{sdks/fog → samples}/scripts/bootstrap +0 -2
  70. data/samples/scripts/wrapper +7 -0
  71. data/samples/sdks/custom/polytrix.yml +2 -0
  72. data/samples/sdks/java/.gitignore +2 -0
  73. data/samples/sdks/java/build.gradle +14 -0
  74. data/samples/sdks/java/challenges/HelloWorld.java +10 -0
  75. data/samples/sdks/java/challenges/Quine.java +31 -0
  76. data/samples/sdks/java/code_sample.tt +11 -0
  77. data/samples/sdks/java/scripts/bootstrap +2 -0
  78. data/samples/sdks/java/scripts/wrapper +8 -0
  79. data/samples/sdks/python/challenges/hello_world.py +2 -0
  80. data/samples/sdks/python/challenges/quine.py +2 -0
  81. data/{sdks/pkgcloud → samples/sdks/python}/scripts/wrapper +1 -1
  82. data/samples/sdks/ruby/challenges/hello_world.rb +4 -0
  83. data/scripts/bootstrap +1 -9
  84. data/scripts/wrapper +7 -0
  85. data/spec/fabricators/challenge_fabricator.rb +17 -0
  86. data/spec/fabricators/manifest_fabricator.rb +50 -0
  87. data/spec/fabricators/validator_fabricator.rb +12 -0
  88. data/spec/fixtures/{polytrix.yml → polytrix_tests.yml} +0 -0
  89. data/spec/fixtures/src-doc/_scenario.md.erb +1 -0
  90. data/spec/polytrix/challenge_runner_spec.rb +3 -3
  91. data/spec/polytrix/challenge_spec.rb +3 -4
  92. data/spec/polytrix/cli_spec.rb +39 -0
  93. data/spec/polytrix/configuration_spec.rb +45 -1
  94. data/spec/polytrix/documentation/helpers/code_helper_spec.rb +120 -0
  95. data/spec/polytrix/documentation_generator_spec.rb +41 -20
  96. data/spec/polytrix/file_finder_spec.rb +4 -3
  97. data/spec/polytrix/implementor_spec.rb +33 -0
  98. data/spec/polytrix/manifest_spec.rb +32 -14
  99. data/spec/polytrix/middleware/feature_executor_spec.rb +1 -1
  100. data/spec/polytrix/result_spec.rb +49 -0
  101. data/spec/polytrix/validations_spec.rb +16 -0
  102. data/spec/polytrix/validator_registry_spec.rb +39 -0
  103. data/spec/polytrix/validator_spec.rb +63 -0
  104. data/spec/polytrix_spec.rb +33 -7
  105. data/spec/spec_helper.rb +14 -1
  106. data/spec/thor_spy.rb +64 -0
  107. metadata +177 -160
  108. data/.rspec_parallel +0 -10
  109. data/Vagrantfile +0 -41
  110. data/features/0_identity_spec.rb +0 -40
  111. data/features/1_cloud_files_spec.rb +0 -48
  112. data/features/2_servers_spec.rb +0 -19
  113. data/features/features_helper.rb +0 -46
  114. data/features/helpers/cloudfiles_helper.rb +0 -31
  115. data/features/helpers/pacto_helper.rb +0 -33
  116. data/features/helpers/teardown_helper.rb +0 -49
  117. data/features/pacto/extensions/loaders/api_blueprint_loader.rb +0 -63
  118. data/features/pacto/extensions/loaders/simple_loader.rb +0 -55
  119. data/features/pacto/extensions/loaders/yaml_or_json_loader.rb +0 -17
  120. data/features/pacto/extensions/matchers.rb +0 -38
  121. data/features/phase2/feature_coverage_report.rb +0 -109
  122. data/features/phase2/run_all_features.rb +0 -14
  123. data/features/static_site/fixtures/index.html +0 -6
  124. data/lib/polytrix/challenge_builder.rb +0 -16
  125. data/lib/polytrix/core/file_finder.rb +0 -43
  126. data/lib/polytrix/core/result_tracker.rb +0 -25
  127. data/lib/polytrix/runners/middleware/pacto.rb +0 -59
  128. data/packer/.gitignore +0 -3
  129. data/packer/Berksfile +0 -15
  130. data/packer/Gemfile +0 -5
  131. data/packer/Vagrantfile +0 -128
  132. data/packer/cookbooks/drg/metadata.rb +0 -27
  133. data/packer/cookbooks/drg/recipes/admins.rb +0 -22
  134. data/packer/cookbooks/drg/recipes/default.rb +0 -9
  135. data/packer/cookbooks/drg/recipes/dotnet.rb +0 -4
  136. data/packer/cookbooks/drg/recipes/golang.rb +0 -4
  137. data/packer/cookbooks/drg/recipes/java.rb +0 -5
  138. data/packer/cookbooks/drg/recipes/php.rb +0 -10
  139. data/packer/cookbooks/drg/recipes/ruby.rb +0 -29
  140. data/packer/cookbooks/drg/recipes/system.rb +0 -13
  141. data/packer/create_box.sh +0 -10
  142. data/packer/http/preseed.cfg +0 -87
  143. data/packer/packer.json +0 -91
  144. data/packer/scripts/root_setup.sh +0 -37
  145. data/packer/scripts/setup.sh +0 -32
  146. data/pacto/config/pacto_server.rb +0 -40
  147. data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/extensions.json +0 -64
  148. data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/flavors/id.json +0 -100
  149. data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/images/id.json +0 -176
  150. data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/servers/id.json +0 -189
  151. data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/servers.json +0 -63
  152. data/pacto/contracts/dns.api.rackspacecloud.com/v1.0/_tenant_id/domains.json +0 -62
  153. data/pacto/contracts/identity.api.rackspacecloud.com/v2.0/tokens.json +0 -192
  154. data/pacto/contracts/monitoring.api.rackspacecloud.com/v1.0/_tenant_id/account.json +0 -39
  155. data/pacto/contracts/ord.autoscale.api.rackspacecloud.com/v1.0/_tenant_id/groups.json +0 -38
  156. data/pacto/contracts/ord.blockstorage.api.rackspacecloud.com/v1/_tenant_id/volumes.json +0 -30
  157. data/pacto/contracts/ord.databases.api.rackspacecloud.com/v1.0/_tenant_id/instances.json +0 -30
  158. data/pacto/contracts/ord.loadbalancers.api.rackspacecloud.com/v1.0/_tenant_id/loadbalancers.json +0 -114
  159. data/pacto/contracts/ord.queues.api.rackspacecloud.com/v1/_tenant_id/queues.json +0 -13
  160. data/pacto/contracts/ord.servers.api.rackspacecloud.com/v2/_tenant_id/os-networksv2.json +0 -46
  161. data/pacto/contracts/ord.servers.api.rackspacecloud.com/v2/_tenant_id/servers/detail.json +0 -230
  162. data/pacto/contracts/storage101.dfw1.clouddrive.com/v1/mosso_account/container/object.json +0 -15
  163. data/pacto/contracts/storage101.dfw1.clouddrive.com/v1/mosso_account.json +0 -43
  164. data/pacto/contracts/storage101.ord1.clouddrive.com/v1/_mosso_id.json +0 -44
  165. data/pacto/pacto_server.rb +0 -100
  166. data/pacto/rackspace_uri_map.yaml +0 -229
  167. data/scripts/cibuild +0 -4
  168. data/sdks/fog/.gitignore +0 -1
  169. data/sdks/fog/Gemfile +0 -5
  170. data/sdks/fog/challenges/all_connections.rb +0 -45
  171. data/sdks/fog/challenges/authenticate_token.rb +0 -15
  172. data/sdks/fog/challenges/cdn_enable_container.rb +0 -20
  173. data/sdks/fog/challenges/create_a_container.rb +0 -17
  174. data/sdks/fog/challenges/create_server.rb +0 -36
  175. data/sdks/fog/challenges/get_object_metadata.rb +0 -13
  176. data/sdks/fog/challenges/list_containers.rb +0 -10
  177. data/sdks/fog/challenges/provision_scalable_webapp.rb +0 -30
  178. data/sdks/fog/challenges/upload_folder.rb +0 -25
  179. data/sdks/fog/scripts/bootstrap.ps1 +0 -1
  180. data/sdks/fog/scripts/wrapper +0 -2
  181. data/sdks/fog/scripts/wrapper.ps1 +0 -1
  182. data/sdks/gophercloud/.gitignore +0 -2
  183. data/sdks/gophercloud/challenges/authenticate_token.go +0 -23
  184. data/sdks/gophercloud/scripts/bootstrap +0 -6
  185. data/sdks/gophercloud/scripts/wrapper +0 -10
  186. data/sdks/jclouds/.gitignore +0 -1
  187. data/sdks/jclouds/challenges/AuthenticateToken.java +0 -115
  188. data/sdks/jclouds/pom.xml +0 -34
  189. data/sdks/jclouds/scripts/bootstrap +0 -3
  190. data/sdks/jclouds/scripts/wrapper +0 -7
  191. data/sdks/openstack.net/.gitignore +0 -4
  192. data/sdks/openstack.net/.nuget/Microsoft.Build.dll +0 -0
  193. data/sdks/openstack.net/.nuget/NuGet.Config +0 -6
  194. data/sdks/openstack.net/.nuget/NuGet.exe +0 -0
  195. data/sdks/openstack.net/.nuget/NuGet.targets +0 -136
  196. data/sdks/openstack.net/Challenge.cs +0 -10
  197. data/sdks/openstack.net/RunChallenge.cs +0 -19
  198. data/sdks/openstack.net/challenges/AuthenticateToken.cs +0 -24
  199. data/sdks/openstack.net/challenges/Weird.cs +0 -133
  200. data/sdks/openstack.net/openstack.net.csproj +0 -58
  201. data/sdks/openstack.net/openstack.net.sln +0 -27
  202. data/sdks/openstack.net/openstack.net.userprefs +0 -8
  203. data/sdks/openstack.net/packages.config +0 -6
  204. data/sdks/openstack.net/scripts/bootstrap +0 -2
  205. data/sdks/openstack.net/scripts/bootstrap.ps1 +0 -2
  206. data/sdks/openstack.net/scripts/wrapper +0 -7
  207. data/sdks/openstack.net/scripts/wrapper.ps1 +0 -1
  208. data/sdks/php-opencloud/.gitignore +0 -4
  209. data/sdks/php-opencloud/challenges/all_connections.php +0 -64
  210. data/sdks/php-opencloud/challenges/authenticate_token.php +0 -14
  211. data/sdks/php-opencloud/challenges/create_server.php +0 -39
  212. data/sdks/php-opencloud/challenges/get_object_metadata.php +0 -19
  213. data/sdks/php-opencloud/composer.json +0 -5
  214. data/sdks/php-opencloud/scripts/bootstrap +0 -4
  215. data/sdks/php-opencloud/scripts/bootstrap.ps1 +0 -2
  216. data/sdks/php-opencloud/scripts/wrapper +0 -2
  217. data/sdks/php-opencloud/scripts/wrapper.ps1 +0 -1
  218. data/sdks/pkgcloud/.gitignore +0 -1
  219. data/sdks/pkgcloud/challenges/authenticate_token.js +0 -17
  220. data/sdks/pkgcloud/challenges/get_object_metadata.js +0 -18
  221. data/sdks/pkgcloud/scripts/bootstrap +0 -2
  222. data/sdks/pkgcloud/scripts/bootstrap.ps1 +0 -1
  223. data/sdks/pkgcloud/scripts/wrapper.ps1 +0 -1
  224. data/sdks/pyrax/.gitignore +0 -2
  225. data/sdks/pyrax/challenges/all_connections.py +0 -61
  226. data/sdks/pyrax/challenges/authenticate_token.py +0 -17
  227. data/sdks/pyrax/challenges/cdn_enable_container.py +0 -22
  228. data/sdks/pyrax/challenges/create_a_container.py +0 -21
  229. data/sdks/pyrax/challenges/create_server.py +0 -35
  230. data/sdks/pyrax/challenges/get_object_metadata.py +0 -17
  231. data/sdks/pyrax/challenges/upload_folder.py +0 -32
  232. data/sdks/pyrax/requirements.txt +0 -21
  233. data/sdks/pyrax/scripts/bootstrap +0 -9
  234. data/sdks/pyrax/scripts/bootstrap.ps1 +0 -7
  235. data/sdks/pyrax/scripts/wrapper +0 -3
  236. data/sdks/pyrax/scripts/wrapper.ps1 +0 -2
  237. data/spec/polytrix/challenge_builder_spec.rb +0 -16
  238. data/spec/rspec_spec.rb +0 -17
@@ -1,43 +0,0 @@
1
- module Polytrix
2
- module Core
3
- module FileFinder
4
- class FileNotFound < StandardError; end
5
-
6
- # Finds a file by loosely matching the file name to a scenario name
7
- def find_file(search_path, scenario_name, ignored_patterns = read_gitignore(search_path))
8
- potential_files = Dir.glob("#{search_path}/**/*#{scenario_name}.*", File::FNM_CASEFOLD)
9
- potential_files.concat Dir.glob("#{search_path}/**/*#{scenario_name.gsub(' ', '_')}.*", File::FNM_CASEFOLD)
10
- potential_files.concat Dir.glob("#{search_path}/**/*#{scenario_name.gsub('_', '')}.*", File::FNM_CASEFOLD)
11
-
12
- # Find the first file, not including generated files
13
- file = potential_files.find { |file|
14
- !ignored? ignored_patterns, search_path, file
15
- }
16
-
17
- fail FileNotFound, "No file was found for #{scenario_name} within #{search_path}" if file.nil?
18
- Pathname.new file
19
- end
20
-
21
- private
22
-
23
- def read_gitignore(dir)
24
- gitignore_file = "#{dir}/.gitignore"
25
- File.read(gitignore_file)
26
- rescue
27
- ""
28
- end
29
-
30
- def ignored?(ignored_patterns, base_path, target_file)
31
- ignored_patterns.split.find do |pattern|
32
- # if git ignores a folder, we should ignore all files it contains
33
- pattern = "#{pattern}**" if pattern[-1] == '/'
34
- relativize(target_file, base_path).fnmatch? pattern
35
- end
36
- end
37
-
38
- def relativize(file, base_path)
39
- Pathname.new(file).relative_path_from Pathname.new(base_path)
40
- end
41
- end
42
- end
43
- end
@@ -1,25 +0,0 @@
1
- require 'singleton'
2
- require 'hashie/mash'
3
-
4
- module Polytrix
5
- class ResultTracker
6
- include Singleton
7
-
8
- attr_reader :results
9
-
10
- def example_started(example)
11
- data_for(example)[example.description] = Hashie::Mash.new
12
- end
13
-
14
- def execution_result(example, result)
15
- data_for(example)[example.description][:execution_result] = result
16
- end
17
-
18
- private
19
- def data_for(example)
20
- @results ||= Hashie::Mash.new
21
- group_names = example.example_group.parent_groups.map{|g| g.description}
22
- group_names.inject(@results, :initializing_reader)
23
- end
24
- end
25
- end
@@ -1,59 +0,0 @@
1
- require 'pacto_server'
2
- require 'goliath/test_helper'
3
-
4
- module Polytrix
5
- module Runners
6
- module Middleware
7
- class Pacto
8
- include Goliath::TestHelper
9
-
10
- def initialize(app, server_options)
11
- @app = app
12
- # FIXM: Ideal would be to start a Pacto server once
13
- # @pacto_server = server(PactoServer, server_options.delete(:port) || 9901, server_options)
14
- # puts "Started Pacto middleware on port #{@pacto_server.port}"
15
- end
16
-
17
- def call(env)
18
- # FIXME: Ideal (continued) and clear the Pacto validation results before each test...
19
- with_pacto do
20
- @app.call(env)
21
- end
22
- # Hacky - need better Pacto API
23
- contracts = ::Pacto::ValidationRegistry.instance.validations.map(&:contract)
24
- # Unknown services aren't captured in detected services
25
- detected_services = contracts.compact.map(&:name)
26
- puts "Services detected: #{detected_services.join ','}"
27
- env[:plugin_data][:pacto] = {
28
- :detected_services => detected_services
29
- }
30
- # ...
31
- end
32
-
33
- private
34
-
35
- def with_pacto
36
- result = nil
37
- puts "Starting Pacto on port #{pacto_port}"
38
- with_api(PactoServer,
39
- stdout: true,
40
- log_file: 'pacto.log',
41
- config: 'pacto/config/pacto_server.rb',
42
- live: true,
43
- generate: generate?,
44
- verbose: true,
45
- validate: true,
46
- directory: File.join(Dir.pwd, 'pacto', 'contracts'),
47
- port: pacto_port
48
- ) do
49
- EM::Synchrony.defer do
50
- result = yield
51
- EM.stop
52
- end
53
- end
54
- result
55
- end
56
- end
57
- end
58
- end
59
- end
data/packer/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- vendor/
2
- Berksfile.lock
3
- output-virtualbox/
data/packer/Berksfile DELETED
@@ -1,15 +0,0 @@
1
- site :opscode
2
-
3
- cookbook 'apt'
4
- cookbook 'python'
5
- cookbook 'rbenv'
6
- cookbook 'golang'
7
- cookbook 'nodejs'
8
- cookbook 'php'
9
- cookbook 'java'
10
- cookbook 'groovy'
11
- cookbook 'maven', git: 'git@github.com:soundcloud-cookbooks/maven.git'
12
- cookbook 'dnsmasq', git: 'git://github.com/maxlinc/dnsmasq.git', branch: "hash_merge"
13
- cookbook 'ssh_known_hosts'
14
- cookbook 'users'
15
- cookbook 'sudo'
data/packer/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- # A sample Gemfile
2
- source "https://rubygems.org"
3
-
4
- gem "berkshelf"
5
-
data/packer/Vagrantfile DELETED
@@ -1,128 +0,0 @@
1
- # -*- mode: ruby -*-
2
- # vi: set ft=ruby :
3
-
4
- # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5
- VAGRANTFILE_API_VERSION = "2"
6
-
7
- Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8
- # All Vagrant configuration is done here. The most common configuration
9
- # options are documented and commented below. For a complete reference,
10
- # please see the online documentation at vagrantup.com.
11
-
12
- # Every Vagrant virtual environment requires a box to build off of.
13
- config.vm.box = "saucy"
14
-
15
- config.vm.provider :rackspace do |rs, override|
16
- override.vm.box = "dummy"
17
- override.ssh.private_key_path = '~/.ssh/id_rsa'
18
- rs.public_key_path = '~/.ssh/id_rsa.pub'
19
- rs.username = ENV['RAX_USERNAME']
20
- rs.api_key = ENV['RAX_API_KEY']
21
- rs.flavor = /512MB/
22
- rs.image = "Ubuntu 13.10 (Saucy Salamander)"
23
- end
24
-
25
- # The url from where the 'config.vm.box' box will be fetched if it
26
- # doesn't already exist on the user's system.
27
- # config.vm.box_url = "http://domain.com/path/to/above.box"
28
-
29
- # Create a forwarded port mapping which allows access to a specific port
30
- # within the machine from a port on the host machine. In the example below,
31
- # accessing "localhost:8080" will access port 80 on the guest machine.
32
- # config.vm.network :forwarded_port, guest: 80, host: 8080
33
-
34
- # Create a private network, which allows host-only access to the machine
35
- # using a specific IP.
36
- # config.vm.network :private_network, ip: "192.168.33.10"
37
-
38
- # Create a public network, which generally matched to bridged network.
39
- # Bridged networks make the machine appear as another physical device on
40
- # your network.
41
- # config.vm.network :public_network
42
-
43
- # If true, then any SSH connections made will enable agent forwarding.
44
- # Default value: false
45
- # config.ssh.forward_agent = true
46
-
47
- # Share an additional folder to the guest VM. The first argument is
48
- # the path on the host to the actual folder. The second argument is
49
- # the path on the guest to mount the folder. And the optional third
50
- # argument is a set of non-required options.
51
- # config.vm.synced_folder "../data", "/vagrant_data"
52
-
53
- # Provider-specific configuration so you can fine-tune various
54
- # backing providers for Vagrant. These expose provider-specific options.
55
- # Example for VirtualBox:
56
- #
57
- # config.vm.provider :virtualbox do |vb|
58
- # # Don't boot with headless mode
59
- # vb.gui = true
60
- #
61
- # # Use VBoxManage to customize the VM. For example to change memory:
62
- # vb.customize ["modifyvm", :id, "--memory", "1024"]
63
- # end
64
- #
65
- # View the documentation for the provider you're using for more
66
- # information on available options.
67
-
68
- # Enable provisioning with Puppet stand alone. Puppet manifests
69
- # are contained in a directory path relative to this Vagrantfile.
70
- # You will need to create the manifests directory and a manifest in
71
- # the file base.pp in the manifests_path directory.
72
- #
73
- # An example Puppet manifest to provision the message of the day:
74
- #
75
- # # group { "puppet":
76
- # # ensure => "present",
77
- # # }
78
- # #
79
- # # File { owner => 0, group => 0, mode => 0644 }
80
- # #
81
- # # file { '/etc/motd':
82
- # # content => "Welcome to your Vagrant-built virtual machine!
83
- # # Managed by Puppet.\n"
84
- # # }
85
- #
86
- # config.vm.provision :puppet do |puppet|
87
- # puppet.manifests_path = "manifests"
88
- # puppet.manifest_file = "site.pp"
89
- # end
90
-
91
- # Enable provisioning with chef solo, specifying a cookbooks path, roles
92
- # path, and data_bags path (all relative to this Vagrantfile), and adding
93
- # some recipes and/or roles.
94
- #
95
- config.vm.provision :chef_solo do |chef|
96
- chef.cookbooks_path = ["cookbooks", "vendor/cookbooks"]
97
- # chef.roles_path = "../my-recipes/roles"
98
- # chef.data_bags_path = "../my-recipes/data_bags"
99
- chef.add_recipe "drg"
100
- # chef.add_role "web"
101
- #
102
- # # You may also specify custom JSON attributes:
103
- # chef.json = { :mysql_password => "foo" }
104
- end
105
-
106
- # Enable provisioning with chef server, specifying the chef server URL,
107
- # and the path to the validation key (relative to this Vagrantfile).
108
- #
109
- # The Opscode Platform uses HTTPS. Substitute your organization for
110
- # ORGNAME in the URL and validation key.
111
- #
112
- # If you have your own Chef Server, use the appropriate URL, which may be
113
- # HTTP instead of HTTPS depending on your configuration. Also change the
114
- # validation key to validation.pem.
115
- #
116
- # config.vm.provision :chef_client do |chef|
117
- # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
118
- # chef.validation_key_path = "ORGNAME-validator.pem"
119
- # end
120
- #
121
- # If you're using the Opscode platform, your validator client is
122
- # ORGNAME-validator, replacing ORGNAME with your organization name.
123
- #
124
- # If you have your own Chef Server, the default validation client name is
125
- # chef-validator, unless you changed the configuration.
126
- #
127
- # chef.validation_client_name = "ORGNAME-validator"
128
- end
@@ -1,27 +0,0 @@
1
- name "drg"
2
- maintainer "Rackspace US, Inc"
3
- maintainer_email "sdk-support@rackspace.com"
4
- license "MIT"
5
- description "Installs tools required for testing Rackspace SDKS."
6
- version "0.0.1"
7
-
8
- depends 'apt'
9
- depends 'python'
10
- depends 'rbenv'
11
- depends 'golang'
12
- depends 'nodejs'
13
- depends 'php'
14
- depends 'java'
15
- depends 'groovy'
16
- depends 'maven'
17
- depends 'dnsmasq'
18
- depends 'ssh_known_hosts'
19
- depends 'users'
20
- depends 'sudo'
21
- depends 'mono'
22
-
23
- recipe "drg", "Installs tools required for testing Rackspace SDKS."
24
-
25
- %w{ ubuntu }.each do |os|
26
- supports os
27
- end
@@ -1,22 +0,0 @@
1
- node.override['authorization']['sudo']['groups'] = ["sudo"]
2
- node.override['authorization']['sudo']['passwordless'] = true
3
- include_recipe 'sudo'
4
-
5
- # Jenkins User... jenkins-jclouds plugin will setup the rest
6
- user "jenkins" do
7
- supports :manage_home => true
8
- home '/jenkins'
9
- end
10
-
11
- group "sudo" do
12
- action :modify
13
- members ["jenkins"]
14
- append true
15
- end
16
-
17
- # /etc/sudoers should be set for "sudo" instead of "wheel", but let's add them just in case
18
- # group "wheel" do
19
- # action :modify
20
- # members ["jenkins"]
21
- # append true
22
- # end
@@ -1,9 +0,0 @@
1
- include_recipe 'drg::system'
2
- include_recipe 'drg::admins'
3
- include_recipe 'python'
4
- include_recipe 'drg::ruby'
5
- include_recipe 'drg::golang'
6
- include_recipe "nodejs::install_from_package"
7
- include_recipe 'drg::php'
8
- include_recipe 'drg::java'
9
- include_recipe 'drg::dotnet'
@@ -1,4 +0,0 @@
1
- # FIXME: May need to setup a PPA to get a more recent Mono
2
- # FIXME: Microsoft.Build.dll was not shipped with current Ubuntu stable Mono, is in latest.
3
- # FIXME: Need to automate `mozroots --import --sync` before Mono can fetch packages.
4
- include_recipe 'mono'
@@ -1,4 +0,0 @@
1
- node.override["go"]["version"] = "1.1.1"
2
- node.override["go"]["filename"] = "go#{node["go"]["version"]}.#{node["os"]}-#{node["go"]["platform"]}.tar.gz"
3
- node.override['go']['url'] = "http://go.googlecode.com/files/#{node["go"]["filename"]}"
4
- include_recipe 'golang'
@@ -1,5 +0,0 @@
1
- node.override['maven']['3']['version'] = '3.1.1'
2
-
3
- include_recipe 'java'
4
- include_recipe 'maven'
5
- include_recipe 'groovy'
@@ -1,10 +0,0 @@
1
- include_recipe 'php'
2
- node.override['php']['directives'] = {
3
- 'date.timezone' => 'GMT'
4
- }
5
-
6
- %w{php5-json php5-curl}.each do |pkg|
7
- package pkg do
8
- action :install
9
- end
10
- end
@@ -1,29 +0,0 @@
1
- if node[:instance_role] == 'vagrant'
2
- # Ideally would be group_users, but see https://github.com/RiotGames/rbenv-cookbook/issues/44
3
- # node.override[:rbenv][:group_users] = ['vagrant']
4
- node.override[:rbenv][:user] = 'vagrant'
5
- else
6
- node.override[:rbenv][:user] = 'jenkins'
7
- end
8
-
9
- include_recipe "rbenv::default"
10
- include_recipe "rbenv::ruby_build"
11
- include_recipe "rbenv::rbenv_vars"
12
-
13
- global_ruby = "2.1.0"
14
- other_rubies = ["1.9.3-p448", "2.0.0-p353"]
15
-
16
- rbenv_ruby global_ruby do
17
- ruby_version global_ruby
18
- global true
19
- end
20
-
21
- other_rubies.each do |version|
22
- rbenv_ruby version
23
- end
24
-
25
- other_rubies.push(global_ruby).each do |version|
26
- rbenv_gem "bundler" do
27
- ruby_version version
28
- end
29
- end
@@ -1,13 +0,0 @@
1
- include_recipe 'apt'
2
-
3
- ssh_known_hosts_entry 'github.com'
4
-
5
- node.force_default[:dnsmasq][:dns] = {
6
- # 'no-poll' => nil,
7
- # 'no-resolv' => nil,
8
- 'bind-interfaces' => nil,
9
- 'server' => '127.0.0.1',
10
- 'address' => '/dev/127.0.0.1'
11
- }
12
-
13
- include_recipe 'dnsmasq'
data/packer/create_box.sh DELETED
@@ -1,10 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- #export PACKER_LOG=1
6
- rm packer_virtualbox_virtualbox.box || true
7
- packer build -var-file ~/.rackspace-creds.json -only=virtualbox packer.json
8
- vagrant box remove vagrant_machine || true
9
- vagrant box add vagrant_machine packer_virtualbox_virtualbox.box
10
-
@@ -1,87 +0,0 @@
1
- ## Options to set on the command line
2
- d-i debian-installer/locale string en_US.utf8
3
- d-i console-setup/ask_detect boolean false
4
- d-i console-setup/layout string USA
5
-
6
- #d-i netcfg/get_hostname string dummy
7
- d-i netcfg/get_hostname string unassigned-hostname
8
- d-i netcfg/get_domain string unassigned-domain
9
-
10
- # Continue without a default route
11
- # Not working , specify a dummy in the DHCP
12
- #d-i netcfg/no_default_route boolean
13
-
14
- d-i time/zone string UTC
15
- d-i clock-setup/utc-auto boolean true
16
- d-i clock-setup/utc boolean true
17
-
18
- d-i kbd-chooser/method select American English
19
-
20
- d-i netcfg/wireless_wep string
21
-
22
- d-i base-installer/kernel/override-image string linux-server
23
- #d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
24
-
25
- # Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
26
- d-i debconf debconf/frontend select Noninteractive
27
-
28
- d-i pkgsel/install-language-support boolean false
29
- tasksel tasksel/first multiselect standard, ubuntu-server
30
-
31
- #d-i partman-auto/method string regular
32
- d-i partman-auto/method string lvm
33
- #d-i partman-auto/purge_lvm_from_device boolean true
34
-
35
- d-i partman-lvm/confirm boolean true
36
- d-i partman-lvm/device_remove_lvm boolean true
37
- d-i partman-auto/choose_recipe select atomic
38
-
39
- d-i partman/confirm_write_new_label boolean true
40
- d-i partman/confirm_nooverwrite boolean true
41
- d-i partman/choose_partition select finish
42
- d-i partman/confirm boolean true
43
-
44
- #http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
45
- #Message: "write the changes to disk and configure lvm preseed"
46
- #http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
47
- #preseed partman-lvm/confirm_nooverwrite boolean true
48
-
49
- # Write the changes to disks and configure LVM?
50
- d-i partman-lvm/confirm boolean true
51
- d-i partman-lvm/confirm_nooverwrite boolean true
52
- d-i partman-auto-lvm/guided_size string max
53
-
54
- ## Default user, we can get away with a recipe to change this
55
- d-i passwd/user-fullname string vagrant
56
- d-i passwd/username string vagrant
57
- d-i passwd/user-password password vagrant
58
- d-i passwd/user-password-again password vagrant
59
- d-i user-setup/encrypt-home boolean false
60
- d-i user-setup/allow-password-weak boolean true
61
-
62
- ## minimum is puppet and ssh and ntp
63
- # Individual additional packages to install
64
- d-i pkgsel/include string openssh-server ntp
65
-
66
- # Whether to upgrade packages after debootstrap.
67
- # Allowed values: none, safe-upgrade, full-upgrade
68
- d-i pkgsel/upgrade select full-upgrade
69
-
70
- d-i grub-installer/only_debian boolean true
71
- d-i grub-installer/with_other_os boolean true
72
- d-i finish-install/reboot_in_progress note
73
-
74
- #For the update
75
- d-i pkgsel/update-policy select none
76
-
77
- # debconf-get-selections --install
78
- #Use mirror
79
- #d-i apt-setup/use_mirror boolean true
80
- #d-i mirror/country string manual
81
- #choose-mirror-bin mirror/protocol string http
82
- #choose-mirror-bin mirror/http/hostname string 192.168.4.150
83
- #choose-mirror-bin mirror/http/directory string /ubuntu
84
- #choose-mirror-bin mirror/suite select maverick
85
- #d-i debian-installer/allow_unauthenticated string true
86
-
87
- choose-mirror-bin mirror/http/proxy string
data/packer/packer.json DELETED
@@ -1,91 +0,0 @@
1
- {
2
- "variables": {
3
- "RAX_USERNAME": null,
4
- "RAX_PASSWORD": null
5
- },
6
- "builders": [
7
- {
8
- "type": "openstack",
9
- "username": "{{user `RAX_USERNAME`}}",
10
- "password": "{{user `RAX_PASSWORD`}}",
11
- "provider": "rackspace-us",
12
- "region": "ORD",
13
- "ssh_username": "root",
14
- "image_name": "DRG",
15
- "source_image": "80fbcb55-b206-41f9-9bc2-2dd7aac6c061",
16
- "flavor": "performance1-2"
17
- },
18
- {
19
- "type": "virtualbox",
20
- "boot_command": [
21
- "<esc><esc><enter><wait>",
22
- "/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
23
- "debian-installer=en_US auto locale=en_US kbd-chooser/method=us <wait>",
24
- "hostname={{ .Name }} <wait>",
25
- "fb=false debconf/frontend=noninteractive <wait>",
26
- "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false <wait>",
27
- "initrd=/install/initrd.gz -- <enter><wait>"
28
- ],
29
- "boot_wait": "4s",
30
- "guest_os_type": "Ubuntu_64",
31
- "http_directory": "http",
32
- "iso_checksum": "4d1a8b720cdd14b76ed9410c63a00d0e",
33
- "iso_checksum_type": "md5",
34
- "iso_url": "http://releases.ubuntu.com/13.10/ubuntu-13.10-server-amd64.iso",
35
- "ssh_username": "vagrant",
36
- "ssh_password": "vagrant",
37
- "ssh_port": 22,
38
- "ssh_wait_timeout": "10000s",
39
- "shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'",
40
- "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
41
- "headless": false,
42
- "virtualbox_version_file": ".vbox_version",
43
- "vboxmanage": [
44
- [
45
- "modifyvm",
46
- "{{.Name}}",
47
- "--memory",
48
- "2048"
49
- ],
50
- [
51
- "modifyvm",
52
- "{{.Name}}",
53
- "--cpus",
54
- "4"
55
- ]
56
- ]
57
- }
58
- ],
59
- "provisioners": [
60
- {
61
- "type": "shell",
62
- "only": ["virtualbox"],
63
- "scripts": [
64
- "scripts/root_setup.sh"
65
- ],
66
- "override": {
67
- "virtualbox": {
68
- "execute_command": "echo 'vagrant' | sudo -S sh '{{ .Path }}'"
69
- }
70
- }
71
- },
72
- {
73
- "type": "shell",
74
- "only": ["virtualbox"],
75
- "scripts": [
76
- "scripts/setup.sh"
77
- ]
78
- },
79
- {
80
- "type": "chef-solo",
81
- "cookbook_paths": ["cookbooks", "vendor/cookbooks"],
82
- "run_list": ["drg"]
83
- }
84
- ],
85
- "post-processors": [
86
- {
87
- "type": "vagrant",
88
- "only": ["virtualbox"]
89
- }
90
- ]
91
- }
@@ -1,37 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- # Updating and Upgrading dependencies
6
- sudo apt-get update -y -qq > /dev/null
7
- sudo apt-get upgrade -y -qq > /dev/null
8
-
9
- # Install necessary libraries for guest additions and Vagrant NFS Share
10
- sudo apt-get -y -q install linux-headers-$(uname -r) build-essential dkms nfs-common
11
-
12
- # Install necessary dependencies
13
- sudo apt-get -y -q install curl wget git tmux firefox xvfb vim
14
-
15
- # Setup sudo to allow no-password sudo for "admin"
16
- groupadd -r admin
17
- usermod -a -G admin vagrant
18
- cp /etc/sudoers /etc/sudoers.orig
19
- sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
20
- sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
21
-
22
- #Install Redis
23
- sudo apt-get -y -q install libjemalloc1
24
- wget -q http://d7jrzzvab3wte.cloudfront.net/checkbot/deb/redis-server_2.6.13-1_amd64.deb
25
- sha1sum redis-server_2.6.13-1_amd64.deb | grep 'ab50cf037fd63e160946f8946b6d318cdf11800d'
26
- dpkg -i redis-server_2.6.13-1_amd64.deb
27
- rm redis-server_2.6.13-1_amd64.deb
28
-
29
- # Install required libraries for RVM and Ruby
30
- sudo apt-get -y -q install gawk libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev libxml2-dev libxslt-dev libxml2
31
-
32
-
33
- # Install Postgresql
34
- sudo apt-get -y -q install postgresql libpq-dev postgresql-contrib
35
-
36
- # Set Password to test for user postgres
37
- sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'test';"