ruby_yacht 0.6.1 → 0.7.0

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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +7 -5
  4. data/doc/TODO.md +1 -5
  5. data/doc/configuration.md +51 -0
  6. data/doc/plugins.md +4 -0
  7. data/lib/ruby_yacht/dsl/configuration.rb +26 -1
  8. data/lib/ruby_yacht/dsl/dsl.rb +35 -3
  9. data/lib/ruby_yacht/dsl/hook.rb +4 -0
  10. data/lib/ruby_yacht/dsl/project.rb +11 -0
  11. data/lib/ruby_yacht/images/app/Dockerfile.erb +2 -1
  12. data/lib/ruby_yacht/images/app/checkout.bash +1 -1
  13. data/lib/ruby_yacht/images/app-dependencies/Dockerfile.erb +7 -1
  14. data/lib/ruby_yacht/images/database/Dockerfile.erb +3 -1
  15. data/lib/ruby_yacht/images/database/checkout.bash +3 -4
  16. data/lib/ruby_yacht/images/web/Dockerfile.erb +2 -0
  17. data/lib/ruby_yacht/plugins/nginx.rb +5 -0
  18. data/lib/ruby_yacht/plugins/rails/scripts/load_seeds.rb +10 -1
  19. data/lib/ruby_yacht/plugins/rails/scripts/prepare_rails_for_launch.rb +1 -1
  20. data/lib/ruby_yacht/plugins/rails/scripts/update_rails_config.rb +6 -4
  21. data/lib/ruby_yacht/plugins/rails.rb +30 -17
  22. data/lib/ruby_yacht/plugins.rb +1 -1
  23. data/lib/ruby_yacht/runner/build_images.rb +5 -7
  24. data/lib/ruby_yacht/runner/run_containers.rb +1 -2
  25. data/ruby_yacht.gemspec +2 -2
  26. data/spec/docker/run.bash +4 -0
  27. data/spec/dsl/configuration_spec.rb +29 -0
  28. data/spec/dsl/dsl_spec.rb +56 -0
  29. data/spec/dsl/hook_spec.rb +28 -5
  30. data/spec/dsl/project_spec.rb +46 -0
  31. data/spec/dsl/server_type_spec.rb +3 -0
  32. data/spec/fixtures/app-dependencies-dockerfile-generic +3 -1
  33. data/spec/fixtures/app-dependencies-dockerfile-generic-with-library-install +3 -1
  34. data/spec/fixtures/app-dependencies-dockerfile-rails +4 -3
  35. data/spec/fixtures/app-dependencies-dockerfile-rails-production +35 -0
  36. data/spec/fixtures/app-dependencies-dockerfile-with-https-repository +25 -0
  37. data/spec/fixtures/app-dependencies-dockerfile-with-no-repository +2 -0
  38. data/spec/fixtures/database-dockerfile +1 -1
  39. data/spec/fixtures/database-dockerfile-mysql +1 -1
  40. data/spec/fixtures/database-dockerfile-rails +2 -6
  41. data/spec/fixtures/database-dockerfile-rails-mysql +38 -0
  42. data/spec/fixtures/database-dockerfile-rails-with-no-repository +1 -3
  43. data/spec/fixtures/database-dockerfile-with-seed-hooks +1 -1
  44. data/spec/fixtures/local_config.yml +8 -0
  45. data/spec/fixtures/mars-dockerfile +0 -1
  46. data/spec/fixtures/mars-dockerfile-rails +0 -1
  47. data/spec/fixtures/mars-dockerfile-rails-with-no-repository +0 -1
  48. data/spec/fixtures/mars-dockerfile-with-after-checkout-hooks +0 -1
  49. data/spec/fixtures/mars-dockerfile-with-before-startup-hooks +0 -1
  50. data/spec/fixtures/mars-dockerfile-with-custom-file-copy +0 -1
  51. data/spec/fixtures/mars-dockerfile-with-local-database +0 -1
  52. data/spec/fixtures/mars-dockerfile-with-no-repository +0 -1
  53. data/spec/fixtures/mars-dockerfile-with-remote-database +0 -1
  54. data/spec/fixtures/mars-startup-rails +1 -1
  55. data/spec/fixtures/mars-startup-rails-with-no-repository +1 -1
  56. data/spec/fixtures/web-dockerfile-nginx +3 -0
  57. data/spec/integration/01_normal_config_spec.rb +352 -0
  58. data/spec/integration/{create_new_project_spec.rb → 02_creating_new_project_spec.rb} +2 -2
  59. data/spec/integration/03_no_repository_spec.rb +56 -0
  60. data/spec/integration/04_no_database_spec.rb +58 -0
  61. data/spec/integration/05_https_repository_spec.rb +52 -0
  62. data/spec/integration/06_production_environment_spec.rb +72 -0
  63. data/spec/integration/07_local_checkout_spec.rb +52 -0
  64. data/spec/integration/08_multiple_projects_spec.rb +46 -0
  65. data/spec/integration/09_titular_app_spec.rb +53 -0
  66. data/spec/integration/10_misc_scenarios_spec.rb +97 -0
  67. data/spec/integration/run.rb +18 -2
  68. data/spec/plugins/rails_spec.rb +73 -16
  69. data/spec/runner/build_images_spec.rb +17 -1
  70. data/spec/runner/run_containers_spec.rb +3 -3
  71. data/spec/support/integration_helpers.rb +18 -4
  72. metadata +30 -20
  73. data/spec/integration/build_images_spec.rb +0 -210
  74. data/spec/integration/build_spec.rb +0 -23
  75. data/spec/integration/checkout_spec.rb +0 -94
  76. data/spec/integration/implode_spec.rb +0 -20
  77. data/spec/integration/run_containers_spec.rb +0 -279
  78. data/spec/integration/services_spec.rb +0 -99
  79. data/spec/integration/shell_spec.rb +0 -31
  80. data/spec/integration/update_hosts_spec.rb +0 -35
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe RubyYacht::Runner::Shell, :integration do
4
- include IntegrationHelpers
5
-
6
- before :all do
7
- configure_project
8
- run_command 'build_images'
9
- run_command 'run_containers'
10
- end
11
-
12
- after :all do
13
- system "cat /etc/hosts*.backup > /etc/hosts"
14
- end
15
-
16
- context 'with a normal command' do
17
- it "returns the results of running that command" do
18
- results = run_command 'shell mars ls', capture_output: true
19
- results = results.split(/\s+/)
20
- expect(results).to include "app"
21
- expect(results).to include "db"
22
- end
23
- end
24
-
25
- context 'with no app name' do
26
- it 'returns a failure' do
27
- results = run_command 'shell'
28
- expect(results).to be_falsey
29
- end
30
- end
31
- end
@@ -1,35 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe RubyYacht::Runner::UpdateHosts, :integration do
4
- include IntegrationHelpers
5
-
6
- before :all do
7
- configure_project
8
- end
9
-
10
- before do
11
- run_command 'update_hosts'
12
- end
13
-
14
- after do
15
- restore_hosts_file
16
- end
17
-
18
- it "puts the domains for the apps in the hosts file" do
19
- results = File.read('/etc/hosts').split("\n")
20
- expect(results).to include '127.0.0.1 apollo.johnbrownlee.com'
21
- expect(results).to include '127.0.0.1 mars.apollo.johnbrownlee.com'
22
- expect(results).to include '127.0.0.1 saturn.apollo.johnbrownlee.com'
23
- end
24
-
25
- it "puts an old copy in the backup" do
26
- timestamp = Time.now.utc.strftime('%Y%m%d%H')
27
- file = Dir["/etc/hosts.#{timestamp}*.backup"].last
28
- expect(file).not_to be_nil
29
- results = File.read(file).split("\n")
30
- expect(results.count).to be > 0
31
- expect(results).not_to include 'apollo.johnbrownlee.com'
32
- expect(results).not_to include 'mars.apollo.johnbrownlee.com'
33
- expect(results).not_to include 'saturn.apollo.johnbrownlee.com'
34
- end
35
- end