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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +7 -5
- data/doc/TODO.md +1 -5
- data/doc/configuration.md +51 -0
- data/doc/plugins.md +4 -0
- data/lib/ruby_yacht/dsl/configuration.rb +26 -1
- data/lib/ruby_yacht/dsl/dsl.rb +35 -3
- data/lib/ruby_yacht/dsl/hook.rb +4 -0
- data/lib/ruby_yacht/dsl/project.rb +11 -0
- data/lib/ruby_yacht/images/app/Dockerfile.erb +2 -1
- data/lib/ruby_yacht/images/app/checkout.bash +1 -1
- data/lib/ruby_yacht/images/app-dependencies/Dockerfile.erb +7 -1
- data/lib/ruby_yacht/images/database/Dockerfile.erb +3 -1
- data/lib/ruby_yacht/images/database/checkout.bash +3 -4
- data/lib/ruby_yacht/images/web/Dockerfile.erb +2 -0
- data/lib/ruby_yacht/plugins/nginx.rb +5 -0
- data/lib/ruby_yacht/plugins/rails/scripts/load_seeds.rb +10 -1
- data/lib/ruby_yacht/plugins/rails/scripts/prepare_rails_for_launch.rb +1 -1
- data/lib/ruby_yacht/plugins/rails/scripts/update_rails_config.rb +6 -4
- data/lib/ruby_yacht/plugins/rails.rb +30 -17
- data/lib/ruby_yacht/plugins.rb +1 -1
- data/lib/ruby_yacht/runner/build_images.rb +5 -7
- data/lib/ruby_yacht/runner/run_containers.rb +1 -2
- data/ruby_yacht.gemspec +2 -2
- data/spec/docker/run.bash +4 -0
- data/spec/dsl/configuration_spec.rb +29 -0
- data/spec/dsl/dsl_spec.rb +56 -0
- data/spec/dsl/hook_spec.rb +28 -5
- data/spec/dsl/project_spec.rb +46 -0
- data/spec/dsl/server_type_spec.rb +3 -0
- data/spec/fixtures/app-dependencies-dockerfile-generic +3 -1
- data/spec/fixtures/app-dependencies-dockerfile-generic-with-library-install +3 -1
- data/spec/fixtures/app-dependencies-dockerfile-rails +4 -3
- data/spec/fixtures/app-dependencies-dockerfile-rails-production +35 -0
- data/spec/fixtures/app-dependencies-dockerfile-with-https-repository +25 -0
- data/spec/fixtures/app-dependencies-dockerfile-with-no-repository +2 -0
- data/spec/fixtures/database-dockerfile +1 -1
- data/spec/fixtures/database-dockerfile-mysql +1 -1
- data/spec/fixtures/database-dockerfile-rails +2 -6
- data/spec/fixtures/database-dockerfile-rails-mysql +38 -0
- data/spec/fixtures/database-dockerfile-rails-with-no-repository +1 -3
- data/spec/fixtures/database-dockerfile-with-seed-hooks +1 -1
- data/spec/fixtures/local_config.yml +8 -0
- data/spec/fixtures/mars-dockerfile +0 -1
- data/spec/fixtures/mars-dockerfile-rails +0 -1
- data/spec/fixtures/mars-dockerfile-rails-with-no-repository +0 -1
- data/spec/fixtures/mars-dockerfile-with-after-checkout-hooks +0 -1
- data/spec/fixtures/mars-dockerfile-with-before-startup-hooks +0 -1
- data/spec/fixtures/mars-dockerfile-with-custom-file-copy +0 -1
- data/spec/fixtures/mars-dockerfile-with-local-database +0 -1
- data/spec/fixtures/mars-dockerfile-with-no-repository +0 -1
- data/spec/fixtures/mars-dockerfile-with-remote-database +0 -1
- data/spec/fixtures/mars-startup-rails +1 -1
- data/spec/fixtures/mars-startup-rails-with-no-repository +1 -1
- data/spec/fixtures/web-dockerfile-nginx +3 -0
- data/spec/integration/01_normal_config_spec.rb +352 -0
- data/spec/integration/{create_new_project_spec.rb → 02_creating_new_project_spec.rb} +2 -2
- data/spec/integration/03_no_repository_spec.rb +56 -0
- data/spec/integration/04_no_database_spec.rb +58 -0
- data/spec/integration/05_https_repository_spec.rb +52 -0
- data/spec/integration/06_production_environment_spec.rb +72 -0
- data/spec/integration/07_local_checkout_spec.rb +52 -0
- data/spec/integration/08_multiple_projects_spec.rb +46 -0
- data/spec/integration/09_titular_app_spec.rb +53 -0
- data/spec/integration/10_misc_scenarios_spec.rb +97 -0
- data/spec/integration/run.rb +18 -2
- data/spec/plugins/rails_spec.rb +73 -16
- data/spec/runner/build_images_spec.rb +17 -1
- data/spec/runner/run_containers_spec.rb +3 -3
- data/spec/support/integration_helpers.rb +18 -4
- metadata +30 -20
- data/spec/integration/build_images_spec.rb +0 -210
- data/spec/integration/build_spec.rb +0 -23
- data/spec/integration/checkout_spec.rb +0 -94
- data/spec/integration/implode_spec.rb +0 -20
- data/spec/integration/run_containers_spec.rb +0 -279
- data/spec/integration/services_spec.rb +0 -99
- data/spec/integration/shell_spec.rb +0 -31
- 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
|