engineyard-serverside 2.1.0.rc1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -78,6 +78,7 @@ module EY
78
78
  def_boolean_option :verbose, false
79
79
  def_boolean_option :precompile_unchanged_assets, false
80
80
  def_boolean_option :ignore_database_adapter_warning, false
81
+ def_boolean_option :eydeploy_rb, true
81
82
  def_boolean_option :maintenance_on_migrate, true
82
83
  def_boolean_option(:maintenance_on_restart) { required_downtime_stack? }
83
84
 
@@ -2,6 +2,7 @@ require 'engineyard-serverside/dependency_manager/base'
2
2
  require 'engineyard-serverside/dependency_manager/bundler'
3
3
  require 'engineyard-serverside/dependency_manager/bundler_lock'
4
4
  require 'engineyard-serverside/dependency_manager/npm'
5
+ require 'engineyard-serverside/dependency_manager/composer'
5
6
 
6
7
  module EY
7
8
  module Serverside
@@ -10,6 +11,7 @@ module EY
10
11
  Bundler.detect(servers, config, shell, runner) ||
11
12
  BundlerLock.detect(servers, config, shell, runner) ||
12
13
  Npm.detect(servers, config, shell, runner) ||
14
+ Composer.detect(servers, config, shell, runner) ||
13
15
  Base.new(servers, config, shell, runner)
14
16
  end
15
17
  end
@@ -0,0 +1,41 @@
1
+ module EY
2
+ module Serverside
3
+ module DependencyManager
4
+ class Composer < Base
5
+ def detected?
6
+ composer_lock? || composer_json?
7
+ end
8
+
9
+ def install
10
+ if composer_available?
11
+ shell.status "Installing composer packages (composer.#{lock_or_json} detected)"
12
+ run "composer install --no-interaction --working-dir #{paths.active_release}"
13
+ else
14
+ shell.warning "composer.#{lock_or_json} detected but composer not available."
15
+ end
16
+ end
17
+
18
+ def lock_or_json
19
+ composer_lock? ? 'lock' : 'json'
20
+ end
21
+
22
+ def composer_lock?
23
+ paths.composer_lock.exist?
24
+ end
25
+
26
+ def composer_json?
27
+ paths.composer_json.exist?
28
+ end
29
+
30
+ def composer_available?
31
+ begin
32
+ run "command -v composer > /dev/null"
33
+ return true
34
+ rescue EY::Serverside::RemoteFailure
35
+ return false
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -20,8 +20,8 @@ module EY
20
20
 
21
21
  def cached_deploy
22
22
  shell.status "Deploying app from cached copy at #{Time.now.asctime}"
23
- require_custom_tasks
24
23
  load_ey_yml
24
+ require_custom_tasks
25
25
  push_code
26
26
 
27
27
  shell.status "Starting full deploy"
@@ -81,8 +81,8 @@ module EY
81
81
  end
82
82
 
83
83
  def restart_with_maintenance_page
84
- require_custom_tasks
85
84
  load_ey_yml
85
+ require_custom_tasks
86
86
  enable_maintenance_page
87
87
  restart
88
88
  disable_maintenance_page
@@ -82,6 +82,8 @@ module EY
82
82
  def_path :public_assets, [:public, 'assets']
83
83
  def_path :public_system, [:public, 'system']
84
84
  def_path :package_json, [:active_release, 'package.json']
85
+ def_path :composer_json, [:active_release, 'composer.json']
86
+ def_path :composer_lock, [:active_release, 'composer.lock']
85
87
  def_path :active_release_config, [:active_release, 'config']
86
88
  def_path :active_log, [:active_release, 'log']
87
89
 
@@ -24,6 +24,8 @@ module EY
24
24
  end
25
25
 
26
26
  def require_custom_tasks
27
+ return unless config.eydeploy_rb?
28
+
27
29
  deploy_file = ["config/eydeploy.rb", "eydeploy.rb"].map do |short_file|
28
30
  paths.repository_cache.join(short_file)
29
31
  end.detect do |file|
@@ -31,12 +33,16 @@ module EY
31
33
  end
32
34
 
33
35
  if deploy_file
34
- shell.status "Loading deployment task overrides from #{deploy_file}"
36
+ shell.notice <<-NOTICE
37
+ NOTICE: Loading deployment task overrides from #{deploy_file}
38
+ Please consider:
39
+ * eydeploy.rb files can drastically alter the behavior of deployments.
40
+ * Internal deployment code may change under this file without warning.
41
+ NOTICE
35
42
  begin
36
43
  instance_eval(deploy_file.read)
37
44
  rescue Exception => e
38
- shell.fatal "Exception while loading #{deploy_file}"
39
- shell.fatal [e.to_s, e.backtrace].join("\n")
45
+ shell.fatal ["Exception while loading #{deploy_file}", e.to_s, e.backtrace].join("\n")
40
46
  raise
41
47
  end
42
48
  end
@@ -1,5 +1,5 @@
1
1
  module EY
2
2
  module Serverside
3
- VERSION = '2.1.0.rc1'
3
+ VERSION = '2.1.0'
4
4
  end
5
5
  end
@@ -77,51 +77,65 @@ describe "the EY::Serverside::Deploy API" do
77
77
 
78
78
  describe "task overrides" do
79
79
  before(:each) do
80
- @tempdir = `mktemp -d -t custom_deploy_spec.XXXXX`.strip
81
- @config = EY::Serverside::Deploy::Configuration.new('app' => 'app_name', 'repository_cache' => @tempdir)
82
- @deploy = FullTestDeploy.realnew(test_servers, @config, test_shell)
80
+ @tempdir = Pathname.new(`mktemp -d -t custom_deploy_spec.XXXXX`.strip)
83
81
  end
84
82
 
85
83
  def write_eydeploy(relative_path, contents = "def got_new_methods() 'from the file on disk' end")
86
- FileUtils.mkdir_p(File.join(
87
- @tempdir,
88
- File.dirname(relative_path)))
84
+ path = @tempdir.join(relative_path)
85
+ path.dirname.mkpath
86
+ path.open('w') { |f| f << contents }
87
+ end
89
88
 
90
- File.open(File.join(@tempdir, relative_path), 'w') do |f|
91
- f.write contents
89
+ describe "eydeploy_rb disabled" do
90
+ before do
91
+ @config = EY::Serverside::Deploy::Configuration.new('app' => 'app_name', 'repository_cache' => @tempdir.to_s, 'eydeploy_rb' => 'false')
92
+ @deploy = FullTestDeploy.realnew(test_servers, @config, test_shell)
92
93
  end
93
- end
94
94
 
95
- it "requires 'eydeploy.rb' and adds any defined methods to the deploy" do
96
- write_eydeploy 'eydeploy.rb'
97
- @deploy.require_custom_tasks
98
- @deploy.got_new_methods.should == 'from the file on disk'
95
+ it "doesn't load eydeploy_rb file" do
96
+ write_eydeploy 'eydeploy.rb'
97
+ @deploy.require_custom_tasks
98
+ @deploy.should_not respond_to(:got_new_methods)
99
+ end
99
100
  end
100
101
 
101
- it "falls back to 'config/eydeploy.rb'" do
102
- write_eydeploy 'config/eydeploy.rb'
103
- @deploy.require_custom_tasks
104
- @deploy.got_new_methods.should == 'from the file on disk'
105
- end
102
+ describe "eydeploy_rb detect or enabled" do
103
+ before do
104
+ @config = EY::Serverside::Deploy::Configuration.new('app' => 'app_name', 'repository_cache' => @tempdir.to_s, 'eydeploy_rb' => 'true')
105
+ @deploy = FullTestDeploy.realnew(test_servers, @config, test_shell)
106
+ end
106
107
 
107
- it "lets you super up from any defined methods" do
108
- write_eydeploy 'eydeploy.rb', "def value() super << ' + derived' end"
108
+ it "requires 'eydeploy.rb' and adds any defined methods to the deploy" do
109
+ write_eydeploy 'eydeploy.rb'
110
+ @deploy.require_custom_tasks
111
+ @deploy.got_new_methods.should == 'from the file on disk'
112
+ end
109
113
 
110
- class TestDeploySuper < FullTestDeploy
111
- def value() 'base' end
114
+ it "falls back to 'config/eydeploy.rb'" do
115
+ write_eydeploy 'config/eydeploy.rb'
116
+ @deploy.require_custom_tasks
117
+ @deploy.got_new_methods.should == 'from the file on disk'
112
118
  end
113
119
 
114
- deploy = TestDeploySuper.realnew(test_servers, @config, test_shell)
115
- deploy.require_custom_tasks
116
- deploy.value.should == "base + derived"
117
- end
120
+ it "lets you super up from any defined methods" do
121
+ write_eydeploy 'eydeploy.rb', "def value() super << ' + derived' end"
122
+
123
+ class TestDeploySuper < FullTestDeploy
124
+ def value() 'base' end
125
+ end
118
126
 
119
- it "records exceptions raised from the instance eval in the log" do
120
- write_eydeploy 'eydeploy.rb', "raise 'Imma blow up'"
121
- lambda { @deploy.require_custom_tasks }.should raise_error
122
- log = @log_path.read
123
- log.should =~ /Exception while loading .*eydeploy\.rb/
124
- log.should include('Imma blow up')
127
+ deploy = TestDeploySuper.realnew(test_servers, @config, test_shell)
128
+ deploy.require_custom_tasks
129
+ deploy.value.should == "base + derived"
130
+ end
131
+
132
+ it "records exceptions raised from the instance eval in the log" do
133
+ write_eydeploy 'eydeploy.rb', "raise 'Imma blow up'"
134
+ lambda { @deploy.require_custom_tasks }.should raise_error
135
+ log = @log_path.read
136
+ log.should =~ /Exception while loading .*eydeploy\.rb/
137
+ log.should include('Imma blow up')
138
+ end
125
139
  end
126
140
  end
127
141
  end
@@ -0,0 +1 @@
1
+ Simple PHP Composer app.
@@ -0,0 +1,5 @@
1
+ {
2
+ "require": {
3
+ "monolog/monolog": "1.2.*"
4
+ }
5
+ }
@@ -0,0 +1,462 @@
1
+ {
2
+ "hash": "6481f6a258c344122ba0157d5eadc0fd",
3
+ "packages": [
4
+ {
5
+ "name": "bjyoungblood/bjy-authorize",
6
+ "version": "1.2.6",
7
+ "source": {
8
+ "type": "git",
9
+ "url": "https://github.com/bjyoungblood/BjyAuthorize.git",
10
+ "reference": "1.2.6"
11
+ },
12
+ "dist": {
13
+ "type": "zip",
14
+ "url": "https://api.github.com/repos/bjyoungblood/BjyAuthorize/zipball/1.2.6",
15
+ "reference": "1.2.6",
16
+ "shasum": ""
17
+ },
18
+ "require": {
19
+ "php": ">=5.3.3",
20
+ "zendframework/zend-permissions-acl": ">=2.1,<3.0",
21
+ "zendframework/zend-mvc": ">=2.1,<3.0",
22
+ "zendframework/zend-eventmanager": ">=2.1,<3.0",
23
+ "zendframework/zend-servicemanager": ">=2.1,<3.0",
24
+ "zendframework/zend-view": ">=2.1,<3.0"
25
+ },
26
+ "require-dev": {
27
+ "doctrine/common": ">=2.3,<2.5-dev",
28
+ "zendframework/zend-developer-tools": "0.*",
29
+ "zf-commons/zfc-user": "0.*"
30
+ },
31
+ "time": "2013-05-12 16:07:25",
32
+ "type": "library",
33
+ "extra": {
34
+ "branch-alias": {
35
+ "dev-master": "1.3-dev"
36
+ }
37
+ },
38
+ "installation-source": "dist",
39
+ "autoload": {
40
+ "psr-0": {
41
+ "BjyAuthorize\\": "src/"
42
+ }
43
+ },
44
+ "license": [
45
+ "BSD-3-Clause"
46
+ ],
47
+ "authors": [
48
+ {
49
+ "name": "Marco Pivetta",
50
+ "email": "ocramius@gmail.com",
51
+ "homepage": "http://ocramius.github.com/",
52
+ "role": "Developer"
53
+ },
54
+ {
55
+ "name": "Ben Youngblood",
56
+ "email": "bx.youngblood@gmail.com",
57
+ "homepage": "http://bjyoungblood.com/",
58
+ "role": "Developer"
59
+ }
60
+ ],
61
+ "description": "Zend\\Acl based firewall system for ZF2 dispatch protection",
62
+ "homepage": "https://github.com/bjyoungblood/BjyAuthorize",
63
+ "keywords": [
64
+ "zf2",
65
+ "acl",
66
+ "zfc-user"
67
+ ]
68
+ },
69
+ {
70
+ "name": "bjyoungblood/bjy-profiler",
71
+ "version": "dev-master",
72
+ "source": {
73
+ "type": "git",
74
+ "url": "https://github.com/bjyoungblood/BjyProfiler.git",
75
+ "reference": "1ca31611b6960bcd744dced95764e3627e8d807a"
76
+ },
77
+ "dist": {
78
+ "type": "zip",
79
+ "url": "https://api.github.com/repos/bjyoungblood/BjyProfiler/zipball/1ca31611b6960bcd744dced95764e3627e8d807a",
80
+ "reference": "1ca31611b6960bcd744dced95764e3627e8d807a",
81
+ "shasum": ""
82
+ },
83
+ "require": {
84
+ "php": ">=5.3",
85
+ "zendframework/zendframework": ">=2.1.0"
86
+ },
87
+ "time": "1364225067",
88
+ "type": "library",
89
+ "installation-source": "source",
90
+ "autoload": {
91
+ "psr-0": {
92
+ "BjyProfiler": "src/"
93
+ },
94
+ "classmap": [
95
+ "./Module.php"
96
+ ]
97
+ },
98
+ "authors": [
99
+ {
100
+ "name": "Ben Youngblood",
101
+ "email": "bx.youngblood@gmail.com",
102
+ "homepage": "http://bjyoungblood.com/",
103
+ "role": "Developer"
104
+ }
105
+ ],
106
+ "description": "Database profiler for Zend\\Db (also plugin for ZendDeveloperTools)",
107
+ "homepage": "https://github.com/bjyoungblood/BjyProfiler",
108
+ "keywords": [
109
+ "db",
110
+ "zf2",
111
+ "profiler",
112
+ "zdt"
113
+ ]
114
+ },
115
+ {
116
+ "name": "darkmatus/roleuserbridge",
117
+ "version": "dev-master",
118
+ "source": {
119
+ "type": "git",
120
+ "url": "https://github.com/dshafik/roleuserbridge",
121
+ "reference": "9f70ef6f24e75c6592f769bd0cd598f135108f48"
122
+ },
123
+ "dist": {
124
+ "type": "zip",
125
+ "url": "https://github.com/dshafik/roleuserbridge/zipball/9f70ef6f24e75c6592f769bd0cd598f135108f48",
126
+ "reference": "9f70ef6f24e75c6592f769bd0cd598f135108f48",
127
+ "shasum": ""
128
+ },
129
+ "require": {
130
+ "php": ">=5.3.3",
131
+ "zendframework/zendframework": "2.*",
132
+ "zf-commons/zfc-base": "0.1.*",
133
+ "zf-commons/zfc-user": "0.1.*",
134
+ "bjyoungblood/bjy-authorize": "1.2.*"
135
+ },
136
+ "time": "1365313580",
137
+ "type": "library",
138
+ "installation-source": "source",
139
+ "autoload": {
140
+ "psr-0": {
141
+ "RoleUserBridge": "src/"
142
+ },
143
+ "classmap": [
144
+ "./"
145
+ ]
146
+ },
147
+ "authors": [
148
+ {
149
+ "name": "Darkmatus",
150
+ "email": "mueller@s-p-it.de",
151
+ "homepage": "https://github.com/darkmatus/"
152
+ }
153
+ ],
154
+ "description": "ZfcUser/BjyAuthorize Bridge for auto-adding User to the user_role_table from BjyAuthorize.",
155
+ "homepage": "https://github.com/darkmatus/roleuserbridge",
156
+ "keywords": [
157
+ "zf2"
158
+ ],
159
+ "support": {
160
+ "source": "https://github.com/dshafik/roleuserbridge/tree/master"
161
+ }
162
+ },
163
+ {
164
+ "name": "zendframework/zend-developer-tools",
165
+ "version": "dev-master",
166
+ "source": {
167
+ "type": "git",
168
+ "url": "https://github.com/zendframework/ZendDeveloperTools",
169
+ "reference": "9e2cf51ffbd3778f07be4a245e6b7a84a6a18a1c"
170
+ },
171
+ "dist": {
172
+ "type": "zip",
173
+ "url": "https://github.com/zendframework/ZendDeveloperTools/zipball/9e2cf51ffbd3778f07be4a245e6b7a84a6a18a1c",
174
+ "reference": "9e2cf51ffbd3778f07be4a245e6b7a84a6a18a1c",
175
+ "shasum": ""
176
+ },
177
+ "require": {
178
+ "php": ">=5.3.3",
179
+ "zendframework/zend-mvc": "2.*",
180
+ "zendframework/zend-eventmanager": "2.*",
181
+ "zendframework/zend-stdlib": "2.*",
182
+ "zendframework/zend-servicemanager": "2.*",
183
+ "zendframework/zend-version": "2.*"
184
+ },
185
+ "suggest": {
186
+ "bjyoungblood/bjy-profiler": "Version: dev-master, allows the usage of the (Zend) Db collector."
187
+ },
188
+ "time": "1368974025",
189
+ "type": "zf-module",
190
+ "installation-source": "source",
191
+ "autoload": {
192
+ "psr-0": {
193
+ "ZendDeveloperTools": "src/"
194
+ },
195
+ "classmap": [
196
+ "./Module.php"
197
+ ]
198
+ },
199
+ "license": [
200
+ "BSD-3-Clause"
201
+ ],
202
+ "authors": [
203
+ {
204
+ "name": "Evan Coury",
205
+ "email": "me@evancoury.com",
206
+ "homepage": "http://blog.evan.pro/"
207
+ },
208
+ {
209
+ "name": "Eric Boh",
210
+ "email": "cossish@gmail.com"
211
+ }
212
+ ],
213
+ "description": "Module for developer and debug tools for working with the ZF2 MVC layer.",
214
+ "homepage": "https://github.com/zendframework/ZendDeveloperTools",
215
+ "keywords": [
216
+ "debug",
217
+ "developer",
218
+ "zf2",
219
+ "module"
220
+ ],
221
+ "support": {
222
+ "source": "https://github.com/zendframework/ZendDeveloperTools/tree/master",
223
+ "issues": "https://github.com/zendframework/ZendDeveloperTools/issues"
224
+ }
225
+ },
226
+ {
227
+ "name": "zendframework/zendframework",
228
+ "version": "2.1.5",
229
+ "source": {
230
+ "type": "git",
231
+ "url": "https://github.com/zendframework/zf2.git",
232
+ "reference": "release-2.1.5"
233
+ },
234
+ "dist": {
235
+ "type": "zip",
236
+ "url": "https://api.github.com/repos/zendframework/zf2/zipball/release-2.1.5",
237
+ "reference": "release-2.1.5",
238
+ "shasum": ""
239
+ },
240
+ "require": {
241
+ "php": ">=5.3.3"
242
+ },
243
+ "replace": {
244
+ "zendframework/zend-authentication": "self.version",
245
+ "zendframework/zend-barcode": "self.version",
246
+ "zendframework/zend-cache": "self.version",
247
+ "zendframework/zend-captcha": "self.version",
248
+ "zendframework/zend-code": "self.version",
249
+ "zendframework/zend-config": "self.version",
250
+ "zendframework/zend-console": "self.version",
251
+ "zendframework/zend-crypt": "self.version",
252
+ "zendframework/zend-db": "self.version",
253
+ "zendframework/zend-debug": "self.version",
254
+ "zendframework/zend-di": "self.version",
255
+ "zendframework/zend-dom": "self.version",
256
+ "zendframework/zend-escaper": "self.version",
257
+ "zendframework/zend-eventmanager": "self.version",
258
+ "zendframework/zend-feed": "self.version",
259
+ "zendframework/zend-file": "self.version",
260
+ "zendframework/zend-filter": "self.version",
261
+ "zendframework/zend-form": "self.version",
262
+ "zendframework/zend-http": "self.version",
263
+ "zendframework/zend-i18n": "self.version",
264
+ "zendframework/zend-inputfilter": "self.version",
265
+ "zendframework/zend-json": "self.version",
266
+ "zendframework/zend-ldap": "self.version",
267
+ "zendframework/zend-loader": "self.version",
268
+ "zendframework/zend-log": "self.version",
269
+ "zendframework/zend-mail": "self.version",
270
+ "zendframework/zend-math": "self.version",
271
+ "zendframework/zend-memory": "self.version",
272
+ "zendframework/zend-mime": "self.version",
273
+ "zendframework/zend-modulemanager": "self.version",
274
+ "zendframework/zend-mvc": "self.version",
275
+ "zendframework/zend-navigation": "self.version",
276
+ "zendframework/zend-paginator": "self.version",
277
+ "zendframework/zend-permissions-acl": "self.version",
278
+ "zendframework/zend-permissions-rbac": "self.version",
279
+ "zendframework/zend-progressbar": "self.version",
280
+ "zendframework/zend-serializer": "self.version",
281
+ "zendframework/zend-server": "self.version",
282
+ "zendframework/zend-servicemanager": "self.version",
283
+ "zendframework/zend-session": "self.version",
284
+ "zendframework/zend-soap": "self.version",
285
+ "zendframework/zend-stdlib": "self.version",
286
+ "zendframework/zend-tag": "self.version",
287
+ "zendframework/zend-test": "self.version",
288
+ "zendframework/zend-text": "self.version",
289
+ "zendframework/zend-uri": "self.version",
290
+ "zendframework/zend-validator": "self.version",
291
+ "zendframework/zend-version": "self.version",
292
+ "zendframework/zend-view": "self.version",
293
+ "zendframework/zend-xmlrpc": "self.version"
294
+ },
295
+ "require-dev": {
296
+ "doctrine/common": ">=2.1",
297
+ "ircmaxell/random-lib": "dev-master",
298
+ "ircmaxell/security-lib": "dev-master",
299
+ "phpunit/phpunit": "3.7.*"
300
+ },
301
+ "suggest": {
302
+ "doctrine/common": "Doctrine\\Common >=2.1 for annotation features",
303
+ "ext-intl": "ext/intl for i18n features",
304
+ "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable",
305
+ "pecl-weakref": "Implementation of weak references for Zend\\Stdlib\\CallbackHandler",
306
+ "zendframework/zendpdf": "ZendPdf for creating PDF representations of barcodes",
307
+ "zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha for rendering ReCaptchas in Zend\\Captcha and/or Zend\\Form"
308
+ },
309
+ "time": "2013-04-17 15:15:58",
310
+ "bin": [
311
+ "bin/classmap_generator.php"
312
+ ],
313
+ "type": "library",
314
+ "extra": {
315
+ "branch-alias": {
316
+ "dev-master": "2.1-dev",
317
+ "dev-develop": "2.2-dev"
318
+ }
319
+ },
320
+ "installation-source": "dist",
321
+ "autoload": {
322
+ "psr-0": {
323
+ "Zend\\": "library/",
324
+ "ZendTest\\": "tests/"
325
+ }
326
+ },
327
+ "license": [
328
+ "BSD-3-Clause"
329
+ ],
330
+ "description": "Zend Framework 2",
331
+ "homepage": "http://framework.zend.com/",
332
+ "keywords": [
333
+ "framework",
334
+ "zf2"
335
+ ]
336
+ },
337
+ {
338
+ "name": "zf-commons/zfc-base",
339
+ "version": "v0.1.2",
340
+ "source": {
341
+ "type": "git",
342
+ "url": "https://github.com/ZF-Commons/ZfcBase.git",
343
+ "reference": "v0.1.2"
344
+ },
345
+ "dist": {
346
+ "type": "zip",
347
+ "url": "https://api.github.com/repos/ZF-Commons/ZfcBase/zipball/v0.1.2",
348
+ "reference": "v0.1.2",
349
+ "shasum": ""
350
+ },
351
+ "require": {
352
+ "php": ">=5.3.3",
353
+ "zendframework/zend-db": ">=2.1,<3.0",
354
+ "zendframework/zend-eventmanager": ">=2.1,<3.0",
355
+ "zendframework/zend-loader": ">=2.1,<3.0",
356
+ "zendframework/zend-modulemanager": ">=2.1,<3.0",
357
+ "zendframework/zend-mvc": ">=2.1,<3.0",
358
+ "zendframework/zend-servicemanager": ">=2.1,<3.0",
359
+ "zendframework/zend-stdlib": ">=2.1,<3.0"
360
+ },
361
+ "time": "2013-05-02 12:33:49",
362
+ "type": "library",
363
+ "installation-source": "dist",
364
+ "autoload": {
365
+ "psr-0": {
366
+ "ZfcBase": "src/"
367
+ },
368
+ "classmap": [
369
+ "./Module.php"
370
+ ]
371
+ },
372
+ "authors": [
373
+ {
374
+ "name": "Kyle Spraggs",
375
+ "email": "theman@spiffyjr.me",
376
+ "homepage": "http://www.spiffyjr.me/"
377
+ },
378
+ {
379
+ "name": "Evan Coury",
380
+ "email": "me@evancoury.com",
381
+ "homepage": "http://blog.evan.pro/"
382
+ }
383
+ ],
384
+ "description": "A set of genetic (abstract) classes which are commonly used across multiple modules.",
385
+ "homepage": "https://github.com/ZF-Commons/ZfcBase",
386
+ "keywords": [
387
+ "zf2"
388
+ ]
389
+ },
390
+ {
391
+ "name": "zf-commons/zfc-user",
392
+ "version": "0.1.2",
393
+ "source": {
394
+ "type": "git",
395
+ "url": "https://github.com/ZF-Commons/ZfcUser.git",
396
+ "reference": "0.1.2"
397
+ },
398
+ "dist": {
399
+ "type": "zip",
400
+ "url": "https://api.github.com/repos/ZF-Commons/ZfcUser/zipball/0.1.2",
401
+ "reference": "0.1.2",
402
+ "shasum": ""
403
+ },
404
+ "require": {
405
+ "php": ">=5.3.3",
406
+ "zendframework/zend-authentication": ">=2.1,<3.0",
407
+ "zendframework/zend-crypt": ">=2.1,<3.0",
408
+ "zendframework/zend-form": ">=2.1,<3.0",
409
+ "zendframework/zend-inputfilter": ">=2.1,<3.0",
410
+ "zendframework/zend-loader": ">=2.1,<3.0",
411
+ "zendframework/zend-modulemanager": ">=2.1,<3.0",
412
+ "zendframework/zend-mvc": ">=2.1,<3.0",
413
+ "zendframework/zend-servicemanager": ">=2.1,<3.0",
414
+ "zendframework/zend-stdlib": ">=2.1,<3.0",
415
+ "zendframework/zend-validator": ">=2.1,<3.0",
416
+ "zendframework/zend-view": ">=2.1,<3.0",
417
+ "zf-commons/zfc-base": "0.*"
418
+ },
419
+ "suggest": {
420
+ "zendframework/zend-session": "To use the default authentication adapter."
421
+ },
422
+ "time": "2013-05-02 12:33:31",
423
+ "type": "library",
424
+ "installation-source": "dist",
425
+ "autoload": {
426
+ "psr-0": {
427
+ "ZfcUser": "src/"
428
+ },
429
+ "classmap": [
430
+ "./Module.php"
431
+ ]
432
+ },
433
+ "authors": [
434
+ {
435
+ "name": "Kyle Spraggs",
436
+ "email": "theman@spiffyjr.me",
437
+ "homepage": "http://www.spiffyjr.me/"
438
+ },
439
+ {
440
+ "name": "Evan Coury",
441
+ "email": "me@evancoury.com",
442
+ "homepage": "http://blog.evan.pro/"
443
+ }
444
+ ],
445
+ "description": "A generic user registration and authentication module for ZF2. Supports Zend\\Db and Doctrine2.",
446
+ "homepage": "https://github.com/ZF-Commons/ZfcUser",
447
+ "keywords": [
448
+ "zf2"
449
+ ]
450
+ }
451
+ ],
452
+ "packages-dev": null,
453
+ "aliases": [
454
+
455
+ ],
456
+ "minimum-stability": "stable",
457
+ "stability-flags": {
458
+ "zendframework/zend-developer-tools": 20,
459
+ "bjyoungblood/bjy-profiler": 20,
460
+ "darkmatus/roleuserbridge": 20
461
+ }
462
+ }
@@ -0,0 +1,4 @@
1
+ <?php
2
+
3
+ echo "Hello, world!";
4
+
@@ -0,0 +1 @@
1
+ Simple PHP Composer app.
@@ -0,0 +1,21 @@
1
+ {
2
+ "repositories": [
3
+ {
4
+ "type": "vcs",
5
+ "url": "https://github.com/zendframework/ZendDeveloperTools"
6
+ },
7
+ {
8
+ "type": "vcs",
9
+ "url": "https://github.com/dshafik/roleuserbridge"
10
+ }
11
+ ],
12
+ "require": {
13
+ "php": ">=5.4.0",
14
+ "zendframework/zendframework": "2.1.*",
15
+ "bjyoungblood/bjy-authorize": "1.2.*",
16
+ "zf-commons/zfc-user": "0.1.*",
17
+ "zendframework/zend-developer-tools": "dev-master",
18
+ "bjyoungblood/bjy-profiler": "dev-master",
19
+ "darkmatus/roleuserbridge": "dev-master"
20
+ }
21
+ }
@@ -0,0 +1,4 @@
1
+ <?php
2
+
3
+ echo "Hello, world!";
4
+
@@ -0,0 +1,59 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Deploying an application that uses PHP and Composer" do
4
+
5
+ context "with composer available" do
6
+
7
+ context "with a composer.lock" do
8
+ before(:all) do
9
+ deploy_test_application('php_composer_lock')
10
+ end
11
+
12
+ it "runs 'composer install'" do
13
+ install_cmd = @deployer.commands.grep(/composer install/).first
14
+ install_cmd.should_not be_nil
15
+ end
16
+ end
17
+
18
+ context "WITHOUT a composer.lock but with composer.json" do
19
+ before(:all) do
20
+ deploy_test_application('php_no_composer_lock')
21
+ end
22
+
23
+ it "runs 'composer install'" do
24
+ install_cmd = @deployer.commands.grep(/composer install/).first
25
+ install_cmd.should_not be_nil
26
+ end
27
+
28
+ end
29
+
30
+ end if $COMPOSER_INSTALLED
31
+
32
+ context "without composer available" do
33
+
34
+ context "with a composer.lock" do
35
+ before(:all) do
36
+ deploy_test_application('php_composer_lock')
37
+ end
38
+
39
+ it "outputs a warning, but continues" do
40
+ warning_out = read_output.should include("WARNING: composer.lock")
41
+ warning_out.should_not be_nil
42
+ end
43
+ end
44
+
45
+ context "WITHOUT a composer.lock but with composer.json" do
46
+ before(:all) do
47
+ deploy_test_application('php_no_composer_lock')
48
+ end
49
+
50
+ it "outputs a warning, but continues" do
51
+ warning_out = read_output.should include("WARNING: composer.json")
52
+ warning_out.should_not be_nil
53
+ end
54
+
55
+ end
56
+
57
+ end if !$COMPOSER_INSTALLED
58
+ end
59
+
data/spec/spec_helper.rb CHANGED
@@ -40,6 +40,13 @@ Spec::Runner.configure do |config|
40
40
  $stderr.puts "npm not found; skipping Node.js specs."
41
41
  end
42
42
 
43
+ $COMPOSER_INSTALLED = system('command -v composer > /dev/null')
44
+ if $COMPOSER_INSTALLED
45
+ $stderr.puts "composer found; skipping tests that expect it to be missing."
46
+ else
47
+ $stderr.puts "composer not found; skipping tests that expect it to be available."
48
+ end
49
+
43
50
  config.before(:all) do
44
51
  make_tmpdir
45
52
  EY::Serverside.dna_json = MultiJson.dump({})
metadata CHANGED
@@ -1,15 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1776706772
5
- prerelease: 6
4
+ hash: 11
5
+ prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
9
  - 0
10
- - rc
11
- - 1
12
- version: 2.1.0.rc1
10
+ version: 2.1.0
13
11
  platform: ruby
14
12
  authors:
15
13
  - EY Cloud Team
@@ -17,12 +15,11 @@ autorequire:
17
15
  bindir: bin
18
16
  cert_chain: []
19
17
 
20
- date: 2013-05-17 00:00:00 Z
18
+ date: 2013-05-28 00:00:00 Z
21
19
  dependencies:
22
20
  - !ruby/object:Gem::Dependency
23
21
  name: rspec
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
26
23
  none: false
27
24
  requirements:
28
25
  - - "="
@@ -33,12 +30,12 @@ dependencies:
33
30
  - 3
34
31
  - 2
35
32
  version: 1.3.2
33
+ prerelease: false
36
34
  type: :development
37
- version_requirements: *id001
35
+ requirement: *id001
38
36
  - !ruby/object:Gem::Dependency
39
37
  name: rake
40
- prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
42
39
  none: false
43
40
  requirements:
44
41
  - - ">="
@@ -57,12 +54,12 @@ dependencies:
57
54
  - 10
58
55
  - 0
59
56
  version: "10.0"
57
+ prerelease: false
60
58
  type: :development
61
- version_requirements: *id002
59
+ requirement: *id002
62
60
  - !ruby/object:Gem::Dependency
63
61
  name: rdoc
64
- prerelease: false
65
- requirement: &id003 !ruby/object:Gem::Requirement
62
+ version_requirements: &id003 !ruby/object:Gem::Requirement
66
63
  none: false
67
64
  requirements:
68
65
  - - ">="
@@ -71,12 +68,12 @@ dependencies:
71
68
  segments:
72
69
  - 0
73
70
  version: "0"
71
+ prerelease: false
74
72
  type: :development
75
- version_requirements: *id003
73
+ requirement: *id003
76
74
  - !ruby/object:Gem::Dependency
77
75
  name: timecop
78
- prerelease: false
79
- requirement: &id004 !ruby/object:Gem::Requirement
76
+ version_requirements: &id004 !ruby/object:Gem::Requirement
80
77
  none: false
81
78
  requirements:
82
79
  - - ">="
@@ -85,12 +82,12 @@ dependencies:
85
82
  segments:
86
83
  - 0
87
84
  version: "0"
85
+ prerelease: false
88
86
  type: :development
89
- version_requirements: *id004
87
+ requirement: *id004
90
88
  - !ruby/object:Gem::Dependency
91
89
  name: simplecov
92
- prerelease: false
93
- requirement: &id005 !ruby/object:Gem::Requirement
90
+ version_requirements: &id005 !ruby/object:Gem::Requirement
94
91
  none: false
95
92
  requirements:
96
93
  - - ">="
@@ -99,12 +96,12 @@ dependencies:
99
96
  segments:
100
97
  - 0
101
98
  version: "0"
99
+ prerelease: false
102
100
  type: :development
103
- version_requirements: *id005
101
+ requirement: *id005
104
102
  - !ruby/object:Gem::Dependency
105
103
  name: engineyard-cloud-client
106
- prerelease: false
107
- requirement: &id006 !ruby/object:Gem::Requirement
104
+ version_requirements: &id006 !ruby/object:Gem::Requirement
108
105
  none: false
109
106
  requirements:
110
107
  - - ~>
@@ -115,12 +112,12 @@ dependencies:
115
112
  - 0
116
113
  - 11
117
114
  version: 1.0.11
115
+ prerelease: false
118
116
  type: :development
119
- version_requirements: *id006
117
+ requirement: *id006
120
118
  - !ruby/object:Gem::Dependency
121
119
  name: engineyard-serverside-adapter
122
- prerelease: false
123
- requirement: &id007 !ruby/object:Gem::Requirement
120
+ version_requirements: &id007 !ruby/object:Gem::Requirement
124
121
  none: false
125
122
  requirements:
126
123
  - - ~>
@@ -131,12 +128,12 @@ dependencies:
131
128
  - 0
132
129
  - 6
133
130
  version: 2.0.6
131
+ prerelease: false
134
132
  type: :development
135
- version_requirements: *id007
133
+ requirement: *id007
136
134
  - !ruby/object:Gem::Dependency
137
135
  name: sqlite3
138
- prerelease: false
139
- requirement: &id008 !ruby/object:Gem::Requirement
136
+ version_requirements: &id008 !ruby/object:Gem::Requirement
140
137
  none: false
141
138
  requirements:
142
139
  - - ">="
@@ -145,8 +142,9 @@ dependencies:
145
142
  segments:
146
143
  - 0
147
144
  version: "0"
145
+ prerelease: false
148
146
  type: :development
149
- version_requirements: *id008
147
+ requirement: *id008
150
148
  description:
151
149
  email: cloud@engineyard.com
152
150
  executables:
@@ -165,6 +163,7 @@ files:
165
163
  - lib/engineyard-serverside/dependency_manager/base.rb
166
164
  - lib/engineyard-serverside/dependency_manager/bundler.rb
167
165
  - lib/engineyard-serverside/dependency_manager/bundler_lock.rb
166
+ - lib/engineyard-serverside/dependency_manager/composer.rb
168
167
  - lib/engineyard-serverside/dependency_manager/legacy_helpers.rb
169
168
  - lib/engineyard-serverside/dependency_manager/npm.rb
170
169
  - lib/engineyard-serverside/dependency_manager.rb
@@ -364,6 +363,13 @@ files:
364
363
  - spec/fixtures/repos/nodejs/package.json
365
364
  - spec/fixtures/repos/nodejs/README
366
365
  - spec/fixtures/repos/not_bundled/README
366
+ - spec/fixtures/repos/php_composer_lock/composer.json
367
+ - spec/fixtures/repos/php_composer_lock/composer.lock
368
+ - spec/fixtures/repos/php_composer_lock/public/index.php
369
+ - spec/fixtures/repos/php_composer_lock/README
370
+ - spec/fixtures/repos/php_no_composer_lock/composer.json
371
+ - spec/fixtures/repos/php_no_composer_lock/public/index.php
372
+ - spec/fixtures/repos/php_no_composer_lock/README
367
373
  - spec/fixtures/repos/sqlite3/Gemfile
368
374
  - spec/fixtures/repos/sqlite3/Gemfile.lock
369
375
  - spec/fixtures/repos/sqlite3/README
@@ -371,6 +377,7 @@ files:
371
377
  - spec/git_strategy_spec.rb
372
378
  - spec/lockfile_parser_spec.rb
373
379
  - spec/nodejs_deploy_spec.rb
380
+ - spec/php_deploy_spec.rb
374
381
  - spec/propagator_spec.rb
375
382
  - spec/rails31_deploy_spec.rb
376
383
  - spec/restart_spec.rb
@@ -530,6 +537,13 @@ test_files:
530
537
  - spec/fixtures/repos/nodejs/package.json
531
538
  - spec/fixtures/repos/nodejs/README
532
539
  - spec/fixtures/repos/not_bundled/README
540
+ - spec/fixtures/repos/php_composer_lock/composer.json
541
+ - spec/fixtures/repos/php_composer_lock/composer.lock
542
+ - spec/fixtures/repos/php_composer_lock/public/index.php
543
+ - spec/fixtures/repos/php_composer_lock/README
544
+ - spec/fixtures/repos/php_no_composer_lock/composer.json
545
+ - spec/fixtures/repos/php_no_composer_lock/public/index.php
546
+ - spec/fixtures/repos/php_no_composer_lock/README
533
547
  - spec/fixtures/repos/sqlite3/Gemfile
534
548
  - spec/fixtures/repos/sqlite3/Gemfile.lock
535
549
  - spec/fixtures/repos/sqlite3/README
@@ -537,6 +551,7 @@ test_files:
537
551
  - spec/git_strategy_spec.rb
538
552
  - spec/lockfile_parser_spec.rb
539
553
  - spec/nodejs_deploy_spec.rb
554
+ - spec/php_deploy_spec.rb
540
555
  - spec/propagator_spec.rb
541
556
  - spec/rails31_deploy_spec.rb
542
557
  - spec/restart_spec.rb