engineyard-serverside 2.3.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/engineyard-serverside/cli.rb +6 -0
- data/lib/engineyard-serverside/configuration.rb +1 -0
- data/lib/engineyard-serverside/dependency_manager.rb +1 -1
- data/lib/engineyard-serverside/dependency_manager/bundler.rb +9 -4
- data/lib/engineyard-serverside/deploy.rb +2 -0
- data/lib/engineyard-serverside/source/git.rb +1 -1
- data/lib/engineyard-serverside/version.rb +1 -1
- data/spec/archive_deploy_spec.rb +1 -0
- data/spec/bundler_deploy_spec.rb +16 -0
- data/spec/deploy_hook_spec.rb +2 -0
- data/spec/fixtures/repos/hooks/deploy/after_deploy.rb +1 -0
- data/spec/fixtures/repos/hooks/deploy/before_deploy.rb +1 -0
- data/spec/spec_helper.rb +13 -11
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODg5ZGYzMGM2MzIyMmI2ZGYyNTQ3NzY1M2MwOWU3YzMxYjZlNGFjNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2FkMGZiNzM2MTEwOTRkOTRlZmYxOTJiZmZiM2VlYjNlNWU0ODE2YQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTgyNWI4OGZiMjhlYWM3N2JiY2U0ODRmNTQzZjI4NTRiNDA0NTg3NDM0NmI2
|
10
|
+
ODlkMThmZDk5NGU4MjM1OTA3NzUwNzZhNjA0NGY4ZTc1OTkwNzY4ZjYwOTcx
|
11
|
+
ZjRjMWM2MTE0ZGVjNWYwMjlhOWM4NmI0MGU5MGRmMDkwMTMxZDQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTQ4MDJiMmI3ZDg0MWJkMDZjOThiNGRlNWYzMWNkMzU4NjZiMGNjY2RmYTAw
|
14
|
+
MDEwYTcyNTQ0ODYzZTA5OGMzMjc1MmJiOWFkZTBhMDc0NWYyOWE2MDQwN2Qx
|
15
|
+
ZDA5OGNjMDQwNThjOTYzYzMyZjhiZDZlMWUwNmQ2Njk0YTQ0YWE=
|
@@ -33,6 +33,9 @@ module EY
|
|
33
33
|
method_option :git, :type => :string,
|
34
34
|
:desc => "Remote git repo to deploy"
|
35
35
|
|
36
|
+
method_option :clean, :type => :boolean,
|
37
|
+
:desc => "Run deploy without relying on existing files"
|
38
|
+
|
36
39
|
|
37
40
|
account_app_env_options
|
38
41
|
config_option
|
@@ -108,6 +111,9 @@ module EY
|
|
108
111
|
# we have to deploy the same SHA there as here
|
109
112
|
integrate_options[:branch] = current_app_dir.join('REVISION').read.strip
|
110
113
|
|
114
|
+
# always rebundle gems on integrate to make sure the instance comes up correctly.
|
115
|
+
integrate_options[:clean] = true
|
116
|
+
|
111
117
|
init_and_propagate(integrate_options, 'integrate') do |servers, config, shell|
|
112
118
|
|
113
119
|
# We have to rsync the entire app dir, so we need all the permissions to be correct!
|
@@ -40,7 +40,7 @@ module EY
|
|
40
40
|
case enabled
|
41
41
|
when 'false', false then nil
|
42
42
|
when 'true', true then klass.new(servers, config, shell, runner)
|
43
|
-
when 'detect'
|
43
|
+
when 'detect', nil then klass.detect(servers, config, shell, runner)
|
44
44
|
else
|
45
45
|
raise "Unknown value #{enabled.inspect} for option #{name.inspect}. Expected [true, false, detect]"
|
46
46
|
end
|
@@ -114,12 +114,17 @@ To fix this problem, commit your Gemfile.lock to your repository and redeploy.
|
|
114
114
|
|
115
115
|
def clean_bundle_on_system_version_change
|
116
116
|
# diff exits with 0 for same and 1/2 for different/file not found.
|
117
|
-
check_ruby = "#{config.ruby_version_command} | diff - #{paths.ruby_version} >/dev/null 2>&1"
|
118
|
-
check_system = "#{config.system_version_command} | diff - #{paths.system_version} >/dev/null 2>&1"
|
119
117
|
clean_bundle = "rm -Rf #{paths.bundled_gems}"
|
120
118
|
|
121
|
-
|
122
|
-
|
119
|
+
if config.clean?
|
120
|
+
shell.substatus "Clean bundle forced (--clean)"
|
121
|
+
run clean_bundle
|
122
|
+
else
|
123
|
+
check_ruby = "#{config.ruby_version_command} | diff - #{paths.ruby_version} >/dev/null 2>&1"
|
124
|
+
check_system = "#{config.system_version_command} | diff - #{paths.system_version} >/dev/null 2>&1"
|
125
|
+
shell.substatus "Checking for system version changes"
|
126
|
+
run "#{check_ruby} && #{check_system} || #{clean_bundle}"
|
127
|
+
end
|
123
128
|
end
|
124
129
|
|
125
130
|
def bundler_version
|
@@ -26,6 +26,7 @@ module EY
|
|
26
26
|
|
27
27
|
shell.status "Starting full deploy"
|
28
28
|
copy_repository_cache
|
29
|
+
callback(:before_deploy)
|
29
30
|
check_repository
|
30
31
|
|
31
32
|
with_failed_release_cleanup do
|
@@ -49,6 +50,7 @@ module EY
|
|
49
50
|
|
50
51
|
cleanup_old_releases
|
51
52
|
gc_repository_cache
|
53
|
+
callback(:after_deploy)
|
52
54
|
shell.status "Finished deploy at #{Time.now.asctime}"
|
53
55
|
rescue Exception => e
|
54
56
|
shell.status "Finished failing to deploy at #{Time.now.asctime}"
|
@@ -2,7 +2,7 @@ require 'engineyard-serverside/source'
|
|
2
2
|
|
3
3
|
# Deploy source for git repository sourced deploy.
|
4
4
|
class EY::Serverside::Source::Git < EY::Serverside::Source
|
5
|
-
require_opts :
|
5
|
+
require_opts :ref, :repository_cache
|
6
6
|
|
7
7
|
def create_revision_file_command(revision_file_path)
|
8
8
|
%Q{#{git} show --pretty=format:"%H" | head -1 > "#{revision_file_path}"}
|
data/spec/archive_deploy_spec.rb
CHANGED
@@ -17,6 +17,7 @@ describe "Deploying a simple application" do
|
|
17
17
|
args.archive = FIXTURES_DIR.join('retwisj.war')
|
18
18
|
args.verbose = true
|
19
19
|
args.instances = [{ :hostname => "localhost", :roles => ["solo"], :name => "single" }]
|
20
|
+
args.serverside_version = Gem::Version.create(EY::Serverside::VERSION.dup).release
|
20
21
|
args.config = {
|
21
22
|
"deploy_to" => deploy_dir,
|
22
23
|
"release_path" => release_path.to_s,
|
data/spec/bundler_deploy_spec.rb
CHANGED
@@ -21,6 +21,8 @@ describe "Deploying an application that uses Bundler" do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
it "removes bundled_gems directory if the ruby or system version changed" do
|
24
|
+
should_run_clear_bundle_cmd = @deployer.commands.grep(/diff/).first
|
25
|
+
should_run_clear_bundle_cmd.should_not be_nil
|
24
26
|
clear_bundle_cmd = @deployer.commands.grep(/rm -Rf \S+\/bundled_gems/).first
|
25
27
|
clear_bundle_cmd.should_not be_nil
|
26
28
|
end
|
@@ -44,6 +46,20 @@ describe "Deploying an application that uses Bundler" do
|
|
44
46
|
end
|
45
47
|
end
|
46
48
|
|
49
|
+
context "with clean option" do
|
50
|
+
before(:all) do
|
51
|
+
deploy_test_application('ey_yml', 'clean' => true)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "removes bundled_gems directory if the ruby or system version changed" do
|
55
|
+
should_run_clear_bundle_cmd = @deployer.commands.grep(/diff/).first
|
56
|
+
should_run_clear_bundle_cmd.should be_nil
|
57
|
+
clear_bundle_cmd = @deployer.commands.grep(/rm -Rf \S+\/bundled_gems/).first
|
58
|
+
clear_bundle_cmd.should_not be_nil
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
47
63
|
context "with bundler disabled in ey.yml" do
|
48
64
|
before(:all) do
|
49
65
|
deploy_test_application('bundler_disabled')
|
data/spec/deploy_hook_spec.rb
CHANGED
@@ -7,6 +7,7 @@ describe "deploy hooks" do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
it "runs all the hooks" do
|
10
|
+
deploy_dir.join('current', 'before_deploy.ran' ).should exist
|
10
11
|
deploy_dir.join('current', 'before_bundle.ran' ).should exist
|
11
12
|
deploy_dir.join('current', 'after_bundle.ran' ).should exist
|
12
13
|
deploy_dir.join('current', 'before_migrate.ran').should exist
|
@@ -17,6 +18,7 @@ describe "deploy hooks" do
|
|
17
18
|
deploy_dir.join('current', 'after_symlink.ran' ).should exist
|
18
19
|
deploy_dir.join('current', 'before_restart.ran').should exist
|
19
20
|
deploy_dir.join('current', 'after_restart.ran' ).should exist
|
21
|
+
deploy_dir.join('current', 'after_deploy.ran' ).should exist
|
20
22
|
end
|
21
23
|
end
|
22
24
|
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch after_deploy.ran'
|
@@ -0,0 +1 @@
|
|
1
|
+
run 'touch before_deploy.ran'
|
data/spec/spec_helper.rb
CHANGED
@@ -251,13 +251,14 @@ exec "$@"
|
|
251
251
|
|
252
252
|
# Create the command to send to CLI.start, even though most of the options are ignored
|
253
253
|
@adapter = EY::Serverside::Adapter.new do |args|
|
254
|
-
args.app
|
255
|
-
args.environment_name
|
256
|
-
args.account_name
|
257
|
-
args.migrate
|
258
|
-
args.ref
|
259
|
-
args.git
|
260
|
-
args.
|
254
|
+
args.app = options['app']
|
255
|
+
args.environment_name = options['environment_name']
|
256
|
+
args.account_name = options['account_name']
|
257
|
+
args.migrate = options['migrate']
|
258
|
+
args.ref = options['branch']
|
259
|
+
args.git = options['git']
|
260
|
+
args.serverside_version = Gem::Version.create(EY::Serverside::VERSION.dup).release
|
261
|
+
args.config = {
|
261
262
|
"services_check_command" => "which echo",
|
262
263
|
"services_setup_command" => "echo 'services setup command'",
|
263
264
|
"source_class" => options["source_class"],
|
@@ -265,10 +266,11 @@ exec "$@"
|
|
265
266
|
"release_path" => options["release_path"],
|
266
267
|
"group" => options["group"]
|
267
268
|
}.merge(options['config'] || {})
|
268
|
-
args.framework_env
|
269
|
-
args.stack
|
270
|
-
args.verbose
|
271
|
-
args.
|
269
|
+
args.framework_env = options['framework_env']
|
270
|
+
args.stack = options['stack']
|
271
|
+
args.verbose = options['verbose']
|
272
|
+
args.clean = options['clean']
|
273
|
+
args.instances = test_servers.map {|s| {:hostname => s.hostname, :roles => s.roles.to_a, :name => s.name} }
|
272
274
|
end
|
273
275
|
|
274
276
|
@argv = @adapter.deploy.commands.last.to_argv[2..-1]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: engineyard-serverside
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- EY Cloud Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.
|
103
|
+
version: 2.2.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 2.
|
110
|
+
version: 2.2.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: sqlite3
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -331,11 +331,13 @@ files:
|
|
331
331
|
- spec/fixtures/repos/hook_fails/README
|
332
332
|
- spec/fixtures/repos/hooks/deploy/after_bundle.rb
|
333
333
|
- spec/fixtures/repos/hooks/deploy/after_compile_assets.rb
|
334
|
+
- spec/fixtures/repos/hooks/deploy/after_deploy.rb
|
334
335
|
- spec/fixtures/repos/hooks/deploy/after_migrate.rb
|
335
336
|
- spec/fixtures/repos/hooks/deploy/after_restart.rb
|
336
337
|
- spec/fixtures/repos/hooks/deploy/after_symlink.rb
|
337
338
|
- spec/fixtures/repos/hooks/deploy/before_bundle.rb
|
338
339
|
- spec/fixtures/repos/hooks/deploy/before_compile_assets.rb
|
340
|
+
- spec/fixtures/repos/hooks/deploy/before_deploy.rb
|
339
341
|
- spec/fixtures/repos/hooks/deploy/before_migrate.rb
|
340
342
|
- spec/fixtures/repos/hooks/deploy/before_restart.rb
|
341
343
|
- spec/fixtures/repos/hooks/deploy/before_symlink.rb
|
@@ -525,11 +527,13 @@ test_files:
|
|
525
527
|
- spec/fixtures/repos/hook_fails/README
|
526
528
|
- spec/fixtures/repos/hooks/deploy/after_bundle.rb
|
527
529
|
- spec/fixtures/repos/hooks/deploy/after_compile_assets.rb
|
530
|
+
- spec/fixtures/repos/hooks/deploy/after_deploy.rb
|
528
531
|
- spec/fixtures/repos/hooks/deploy/after_migrate.rb
|
529
532
|
- spec/fixtures/repos/hooks/deploy/after_restart.rb
|
530
533
|
- spec/fixtures/repos/hooks/deploy/after_symlink.rb
|
531
534
|
- spec/fixtures/repos/hooks/deploy/before_bundle.rb
|
532
535
|
- spec/fixtures/repos/hooks/deploy/before_compile_assets.rb
|
536
|
+
- spec/fixtures/repos/hooks/deploy/before_deploy.rb
|
533
537
|
- spec/fixtures/repos/hooks/deploy/before_migrate.rb
|
534
538
|
- spec/fixtures/repos/hooks/deploy/before_restart.rb
|
535
539
|
- spec/fixtures/repos/hooks/deploy/before_symlink.rb
|