engineyard-serverside 1.6.5 → 1.7.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/engineyard-serverside.rb +2 -0
- data/lib/engineyard-serverside/cli.rb +83 -48
- data/lib/engineyard-serverside/configuration.rb +85 -18
- data/lib/engineyard-serverside/deploy.rb +105 -91
- data/lib/engineyard-serverside/deploy_hook.rb +22 -20
- data/lib/engineyard-serverside/deprecation.rb +9 -17
- data/lib/engineyard-serverside/future.rb +10 -4
- data/lib/engineyard-serverside/futures/celluloid.rb +3 -13
- data/lib/engineyard-serverside/futures/dataflow.rb +8 -13
- data/lib/engineyard-serverside/lockfile_parser.rb +1 -1
- data/lib/engineyard-serverside/rails_asset_support.rb +26 -10
- data/lib/engineyard-serverside/server.rb +17 -12
- data/lib/engineyard-serverside/shell.rb +98 -0
- data/lib/engineyard-serverside/shell/formatter.rb +71 -0
- data/lib/engineyard-serverside/shell/helpers.rb +29 -0
- data/lib/engineyard-serverside/strategies/git.rb +33 -63
- data/lib/engineyard-serverside/task.rb +34 -13
- data/lib/engineyard-serverside/version.rb +1 -1
- data/spec/basic_deploy_spec.rb +15 -50
- data/spec/bundler_deploy_spec.rb +3 -44
- data/spec/configuration_spec.rb +72 -0
- data/spec/custom_deploy_spec.rb +3 -4
- data/spec/deploy_hook_spec.rb +210 -162
- data/spec/deprecation_spec.rb +4 -26
- data/spec/ey_yml_customized_deploy_spec.rb +68 -0
- data/spec/fixtures/repos/assets_disabled/Gemfile +6 -0
- data/spec/fixtures/repos/assets_disabled/Gemfile.lock +90 -0
- data/spec/fixtures/repos/assets_disabled/README +1 -0
- data/spec/fixtures/repos/assets_disabled/Rakefile +5 -0
- data/spec/fixtures/repos/assets_disabled/config/application.rb +5 -0
- data/spec/fixtures/repos/assets_disabled_in_ey_yml/Gemfile +6 -0
- data/spec/fixtures/repos/assets_disabled_in_ey_yml/Gemfile.lock +90 -0
- data/spec/fixtures/repos/assets_disabled_in_ey_yml/README +1 -0
- data/spec/fixtures/repos/assets_disabled_in_ey_yml/Rakefile +5 -0
- data/spec/fixtures/repos/assets_disabled_in_ey_yml/config/application.rb +5 -0
- data/spec/fixtures/repos/assets_disabled_in_ey_yml/config/ey.yml +4 -0
- data/spec/fixtures/repos/assets_enabled/Gemfile +6 -0
- data/spec/fixtures/repos/assets_enabled/Gemfile.lock +90 -0
- data/spec/fixtures/repos/assets_enabled/README +1 -0
- data/spec/fixtures/repos/assets_enabled/Rakefile +5 -0
- data/spec/fixtures/repos/assets_enabled/config/application.rb +5 -0
- data/spec/fixtures/repos/assets_enabled_in_ey_yml/README +1 -0
- data/spec/fixtures/repos/assets_enabled_in_ey_yml/Rakefile +5 -0
- data/spec/fixtures/repos/assets_enabled_in_ey_yml/config/ey.yml +4 -0
- data/spec/fixtures/repos/assets_in_hook/Gemfile +6 -0
- data/spec/fixtures/repos/assets_in_hook/Gemfile.lock +90 -0
- data/spec/fixtures/repos/assets_in_hook/README +2 -0
- data/spec/fixtures/repos/assets_in_hook/Rakefile +5 -0
- data/spec/fixtures/repos/assets_in_hook/config/application.rb +5 -0
- data/spec/fixtures/repos/assets_in_hook/deploy/before_migrate.rb +1 -0
- data/spec/fixtures/repos/default/Gemfile +5 -0
- data/spec/fixtures/repos/default/Gemfile.lock +14 -0
- data/spec/fixtures/repos/default/README +5 -0
- data/spec/fixtures/repos/ey_yml/Gemfile +4 -0
- data/spec/fixtures/repos/ey_yml/Gemfile.lock +12 -0
- data/spec/fixtures/repos/ey_yml/README +1 -0
- data/spec/fixtures/repos/ey_yml/config/ey.yml +12 -0
- data/spec/fixtures/repos/ey_yml/deploy/before_migrate.rb +6 -0
- data/spec/fixtures/repos/ey_yml_alt/Gemfile +4 -0
- data/spec/fixtures/repos/ey_yml_alt/Gemfile.lock +12 -0
- data/spec/fixtures/repos/ey_yml_alt/README +1 -0
- data/spec/fixtures/repos/ey_yml_alt/deploy/before_migrate.rb +6 -0
- data/spec/fixtures/repos/ey_yml_alt/ey.yml +12 -0
- data/spec/fixtures/repos/hook_fails/README +1 -0
- data/spec/fixtures/repos/hook_fails/deploy/before_migrate.rb +1 -0
- data/spec/fixtures/repos/hooks/README +1 -0
- data/spec/fixtures/repos/hooks/deploy/after_bundle.rb +1 -0
- data/spec/fixtures/repos/hooks/deploy/after_compile_assets.rb +1 -0
- data/spec/fixtures/repos/hooks/deploy/after_migrate.rb +1 -0
- data/spec/fixtures/repos/hooks/deploy/after_restart.rb +1 -0
- data/spec/fixtures/repos/hooks/deploy/after_symlink.rb +1 -0
- data/spec/fixtures/repos/hooks/deploy/before_bundle.rb +1 -0
- data/spec/fixtures/repos/hooks/deploy/before_compile_assets.rb +1 -0
- data/spec/fixtures/repos/hooks/deploy/before_migrate.rb +1 -0
- data/spec/fixtures/repos/hooks/deploy/before_restart.rb +1 -0
- data/spec/fixtures/repos/hooks/deploy/before_symlink.rb +1 -0
- data/spec/fixtures/repos/no_ey_config/Gemfile +4 -0
- data/spec/fixtures/repos/no_ey_config/Gemfile.lock +12 -0
- data/spec/fixtures/repos/no_ey_config/README +1 -0
- data/spec/fixtures/repos/no_gemfile_lock/Gemfile +5 -0
- data/spec/fixtures/repos/no_gemfile_lock/README +1 -0
- data/spec/fixtures/repos/nodejs/README +1 -0
- data/spec/fixtures/repos/nodejs/package.json +7 -0
- data/spec/fixtures/repos/not_bundled/README +1 -0
- data/spec/fixtures/{gemfiles/1.0.21-rails-31-with-sqlite → repos/sqlite3/Gemfile} +0 -0
- data/spec/fixtures/{lockfiles/1.0.21-rails-31-with-sqlite → repos/sqlite3/Gemfile.lock} +0 -0
- data/spec/fixtures/repos/sqlite3/README +1 -0
- data/spec/git_strategy_spec.rb +11 -2
- data/spec/lockfile_parser_spec.rb +8 -3
- data/spec/nodejs_deploy_spec.rb +1 -26
- data/spec/rails31_deploy_spec.rb +23 -31
- data/spec/services_deploy_spec.rb +41 -100
- data/spec/shell_spec.rb +50 -0
- data/spec/spec_helper.rb +80 -66
- data/spec/sqlite3_deploy_spec.rb +10 -16
- data/spec/support/integration.rb +45 -139
- metadata +233 -78
- data/lib/engineyard-serverside/logged_output.rb +0 -91
- data/spec/logged_output_spec.rb +0 -55
@@ -0,0 +1 @@
|
|
1
|
+
Standard rails31 app with asset compilation enabled.
|
@@ -0,0 +1 @@
|
|
1
|
+
an app that we otherwise wouldn't compile assets, but precompile_assets is set to true in ey.yml
|
@@ -0,0 +1,90 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionmailer (3.2.3)
|
5
|
+
actionpack (= 3.2.3)
|
6
|
+
mail (~> 2.4.4)
|
7
|
+
actionpack (3.2.3)
|
8
|
+
activemodel (= 3.2.3)
|
9
|
+
activesupport (= 3.2.3)
|
10
|
+
builder (~> 3.0.0)
|
11
|
+
erubis (~> 2.7.0)
|
12
|
+
journey (~> 1.0.1)
|
13
|
+
rack (~> 1.4.0)
|
14
|
+
rack-cache (~> 1.2)
|
15
|
+
rack-test (~> 0.6.1)
|
16
|
+
sprockets (~> 2.1.2)
|
17
|
+
activemodel (3.2.3)
|
18
|
+
activesupport (= 3.2.3)
|
19
|
+
builder (~> 3.0.0)
|
20
|
+
activerecord (3.2.3)
|
21
|
+
activemodel (= 3.2.3)
|
22
|
+
activesupport (= 3.2.3)
|
23
|
+
arel (~> 3.0.2)
|
24
|
+
tzinfo (~> 0.3.29)
|
25
|
+
activeresource (3.2.3)
|
26
|
+
activemodel (= 3.2.3)
|
27
|
+
activesupport (= 3.2.3)
|
28
|
+
activesupport (3.2.3)
|
29
|
+
i18n (~> 0.6)
|
30
|
+
multi_json (~> 1.0)
|
31
|
+
arel (3.0.2)
|
32
|
+
builder (3.0.0)
|
33
|
+
erubis (2.7.0)
|
34
|
+
ey_config (0.0.5)
|
35
|
+
hike (1.2.1)
|
36
|
+
i18n (0.6.0)
|
37
|
+
journey (1.0.3)
|
38
|
+
json (1.6.6)
|
39
|
+
mail (2.4.4)
|
40
|
+
i18n (>= 0.4.0)
|
41
|
+
mime-types (~> 1.16)
|
42
|
+
treetop (~> 1.4.8)
|
43
|
+
mime-types (1.18)
|
44
|
+
multi_json (1.3.2)
|
45
|
+
pg (0.13.2)
|
46
|
+
polyglot (0.3.3)
|
47
|
+
rack (1.4.1)
|
48
|
+
rack-cache (1.2)
|
49
|
+
rack (>= 0.4)
|
50
|
+
rack-ssl (1.3.2)
|
51
|
+
rack
|
52
|
+
rack-test (0.6.1)
|
53
|
+
rack (>= 1.0)
|
54
|
+
rails (3.2.3)
|
55
|
+
actionmailer (= 3.2.3)
|
56
|
+
actionpack (= 3.2.3)
|
57
|
+
activerecord (= 3.2.3)
|
58
|
+
activeresource (= 3.2.3)
|
59
|
+
activesupport (= 3.2.3)
|
60
|
+
bundler (~> 1.0)
|
61
|
+
railties (= 3.2.3)
|
62
|
+
railties (3.2.3)
|
63
|
+
actionpack (= 3.2.3)
|
64
|
+
activesupport (= 3.2.3)
|
65
|
+
rack-ssl (~> 1.3.2)
|
66
|
+
rake (>= 0.8.7)
|
67
|
+
rdoc (~> 3.4)
|
68
|
+
thor (~> 0.14.6)
|
69
|
+
rake (0.9.2.2)
|
70
|
+
rdoc (3.12)
|
71
|
+
json (~> 1.4)
|
72
|
+
sprockets (2.1.2)
|
73
|
+
hike (~> 1.2)
|
74
|
+
rack (~> 1.0)
|
75
|
+
tilt (~> 1.1, != 1.3.0)
|
76
|
+
thor (0.14.6)
|
77
|
+
tilt (1.3.3)
|
78
|
+
treetop (1.4.10)
|
79
|
+
polyglot
|
80
|
+
polyglot (>= 0.3.1)
|
81
|
+
tzinfo (0.3.33)
|
82
|
+
|
83
|
+
PLATFORMS
|
84
|
+
ruby
|
85
|
+
|
86
|
+
DEPENDENCIES
|
87
|
+
ey_config
|
88
|
+
pg
|
89
|
+
rails
|
90
|
+
rake
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch custom_compiled && mkdir public/assets'
|
@@ -0,0 +1 @@
|
|
1
|
+
This repo has an ey.yml file for testing config loading.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
environments:
|
2
|
+
env:
|
3
|
+
copy_exclude:
|
4
|
+
- .git
|
5
|
+
- README
|
6
|
+
migrate: true
|
7
|
+
migration_command: 'uh oh'
|
8
|
+
branch: branch_from_ey_yml
|
9
|
+
custom: custom_from_ey_yml
|
10
|
+
bundle_without: only test
|
11
|
+
maintenance_on_migrate: false
|
12
|
+
ignore_database_adapter_warning: true
|
@@ -0,0 +1 @@
|
|
1
|
+
This repo has an ey.yml file for testing config loading.
|
@@ -0,0 +1 @@
|
|
1
|
+
In this app the before migrate hook raises.
|
@@ -0,0 +1 @@
|
|
1
|
+
raise "Hook failing in #{__FILE__}"
|
@@ -0,0 +1 @@
|
|
1
|
+
Run ALL of the hooks!
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch after_bundle.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch after_compile_assets.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch after_migrate.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch after_restart.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch after_symlink.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch before_bundle.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch before_compile_assets.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch before_migrate.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch before_restart.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch before_symlink.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
This repo is missing ey_config which is used for services testing.
|
@@ -0,0 +1 @@
|
|
1
|
+
Gemfile, but no Gemfile.lock
|
@@ -0,0 +1 @@
|
|
1
|
+
Simple Node.js app.
|
@@ -0,0 +1 @@
|
|
1
|
+
This app is not bundled. No Gemfile or Gemfile lock here.
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
This repo uses sqlite3 gem instead of the usual database adapters.
|
data/spec/git_strategy_spec.rb
CHANGED
@@ -2,8 +2,17 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe "the git deploy strategy" do
|
4
4
|
subject do
|
5
|
-
|
6
|
-
|
5
|
+
fixtures_dir = Pathname.new(__FILE__).dirname.join("fixtures")
|
6
|
+
gitrepo_dir = Pathname.new(Dir.tmpdir).join("gitrepo-#{Time.now.to_i}-#{$$}")
|
7
|
+
gitrepo_dir.mkdir
|
8
|
+
system "tar xzf #{fixtures_dir.join('gitrepo.tar.gz')} --strip-components 1 -C #{gitrepo_dir}"
|
9
|
+
|
10
|
+
EY::Serverside::Strategies::Git.new(
|
11
|
+
test_shell,
|
12
|
+
:repo => FIXTURES_DIR.join('repos','default'),
|
13
|
+
:repository_cache => gitrepo_dir,
|
14
|
+
:ref => "master"
|
15
|
+
)
|
7
16
|
end
|
8
17
|
|
9
18
|
before { subject.checkout }
|
@@ -18,6 +18,11 @@ describe "the bundler version retrieved from the lockfile" do
|
|
18
18
|
lambda { get_version('0.9-with-bundler') }.should raise_error(RuntimeError, /Malformed or pre bundler-1.0.0 Gemfile.lock/)
|
19
19
|
end
|
20
20
|
|
21
|
+
it "has a default version" do
|
22
|
+
EY::Serverside::LockfileParser.default_version.should == "1.1.3"
|
23
|
+
EY::Serverside::LockfileParser::DEFAULT.should == "1.1.3"
|
24
|
+
end
|
25
|
+
|
21
26
|
it "returns the default version for a 1.0 lockfile without a bundler dependency" do
|
22
27
|
get_version('1.0-no-bundler').should == EY::Serverside::LockfileParser::DEFAULT
|
23
28
|
end
|
@@ -80,15 +85,15 @@ describe "the bundler version retrieved from the lockfile" do
|
|
80
85
|
end
|
81
86
|
|
82
87
|
it "uses the default version when we get a pessimistic qualifier and is lower than the default version" do
|
83
|
-
subject.fetch_version('1.
|
88
|
+
subject.fetch_version('1.1.1', '~>').should == EY::Serverside::LockfileParser::DEFAULT
|
84
89
|
end
|
85
90
|
|
86
91
|
it "uses the given version when we get a pessimistic qualifier that doesn't match the default version" do
|
87
|
-
subject.fetch_version('1.
|
92
|
+
subject.fetch_version('1.0.0', '~>').should == '1.0.0'
|
88
93
|
end
|
89
94
|
|
90
95
|
it "uses the given version when it's geater of equal than the default version" do
|
91
|
-
subject.fetch_version('1.
|
96
|
+
subject.fetch_version('1.2.0', '>=').should == '1.2.0'
|
92
97
|
end
|
93
98
|
|
94
99
|
it "uses the default version when the given version is lower" do
|
data/spec/nodejs_deploy_spec.rb
CHANGED
@@ -1,33 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe "Deploying an application that uses Node.js and NPM" do
|
4
|
-
def deploy_test_application
|
5
|
-
@deploy_dir = File.join(Dir.tmpdir, "serverside-deploy-#{Time.now.to_i}-#{$$}")
|
6
|
-
|
7
|
-
# set up EY::Serverside::Server like we're on a solo
|
8
|
-
EY::Serverside::Server.reset
|
9
|
-
EY::Serverside::Server.add(:hostname => 'localhost', :roles => %w[solo])
|
10
|
-
|
11
|
-
# run a deploy
|
12
|
-
config = EY::Serverside::Deploy::Configuration.new({
|
13
|
-
"strategy" => "NodeIntegrationSpec",
|
14
|
-
"deploy_to" => @deploy_dir,
|
15
|
-
"group" => `id -gn`.strip,
|
16
|
-
"stack" => 'nginx_nodejs',
|
17
|
-
'app' => 'nodeapp',
|
18
|
-
'framework_env' => 'staging'
|
19
|
-
})
|
20
|
-
|
21
|
-
@binpath = File.expand_path(File.join(File.dirname(__FILE__), '..', 'bin', 'engineyard-serverside'))
|
22
|
-
@deployer = FullTestDeploy.new(config)
|
23
|
-
@deployer.deploy do
|
24
|
-
FileUtils.mkdir_p(config.repository_cache) # block runs before deploy
|
25
|
-
@deployer.generate_package_json_in(config.repository_cache)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
4
|
before(:all) do
|
30
|
-
deploy_test_application
|
5
|
+
deploy_test_application('nodejs')
|
31
6
|
end
|
32
7
|
|
33
8
|
it "runs 'npm install'" do
|