engineyard-serverside 2.8.0.pre → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (312) hide show
  1. checksums.yaml +7 -0
  2. data/bin/engineyard-serverside-execute-service-hook +1 -1
  3. data/features/hook/running-a-deploy-hook.feature +277 -0
  4. data/features/hook/step_definitions/running-a-deploy-hook-steps.rb +200 -0
  5. data/features/step_definitions/command_steps.rb +8 -0
  6. data/features/step_definitions/version_steps.rb +5 -0
  7. data/features/support/env.rb +63 -0
  8. data/features/support/error_codes.rb +17 -0
  9. data/features/support/fs_helpers.rb +82 -0
  10. data/features/support/output_helpers.rb +7 -0
  11. data/features/support/runner.rb +41 -0
  12. data/features/version.feature +7 -0
  13. data/lib/engineyard-serverside.rb +2 -5
  14. data/lib/engineyard-serverside/callbacks/collection/base.rb +12 -5
  15. data/lib/engineyard-serverside/callbacks/distributor.rb +2 -7
  16. data/lib/engineyard-serverside/callbacks/executor/executable.rb +2 -0
  17. data/lib/engineyard-serverside/cli/app.rb +6 -0
  18. data/lib/engineyard-serverside/cli/workflows/calling_deploy_hooks.rb +1 -2
  19. data/lib/engineyard-serverside/configuration.rb +3 -3
  20. data/lib/engineyard-serverside/deploy.rb +4 -8
  21. data/lib/engineyard-serverside/shell.rb +38 -10
  22. data/lib/engineyard-serverside/version.rb +1 -1
  23. data/spec/engineyard-serverside/callbacks/collection/combined_spec.rb +232 -0
  24. data/spec/engineyard-serverside/callbacks/collection/deploy_hooks_spec.rb +170 -0
  25. data/spec/engineyard-serverside/callbacks/collection/service_hooks/collection_spec.rb +171 -0
  26. data/spec/engineyard-serverside/callbacks/collection/service_hooks/combined_spec.rb +174 -0
  27. data/spec/engineyard-serverside/callbacks/collection/service_hooks_spec.rb +31 -0
  28. data/spec/engineyard-serverside/callbacks/collection_spec.rb +49 -0
  29. data/spec/engineyard-serverside/callbacks/distributor/remote_spec.rb +135 -0
  30. data/spec/engineyard-serverside/callbacks/distributor/viability_filter_spec.rb +208 -0
  31. data/spec/engineyard-serverside/callbacks/distributor_spec.rb +43 -0
  32. data/spec/engineyard-serverside/callbacks/executor/executable_spec.rb +386 -0
  33. data/spec/engineyard-serverside/callbacks/executor/ruby/context_spec.rb +538 -0
  34. data/spec/engineyard-serverside/callbacks/executor/ruby/executor_spec.rb +313 -0
  35. data/spec/engineyard-serverside/callbacks/executor/ruby_spec.rb +35 -0
  36. data/spec/engineyard-serverside/callbacks/executor_spec.rb +45 -0
  37. data/spec/engineyard-serverside/callbacks_spec.rb +31 -0
  38. data/spec/engineyard-serverside/cli/workflows/base_spec.rb +237 -0
  39. data/spec/engineyard-serverside/cli/workflows/calling_deploy_hooks_spec.rb +65 -0
  40. data/spec/engineyard-serverside/cli/workflows/deploying_applications_spec.rb +61 -0
  41. data/spec/engineyard-serverside/cli/workflows/disabling_maintenance_spec.rb +61 -0
  42. data/spec/engineyard-serverside/cli/workflows/enabling_maintenance_spec.rb +61 -0
  43. data/spec/engineyard-serverside/cli/workflows/helpers_spec.rb +64 -0
  44. data/spec/engineyard-serverside/cli/workflows/rolling_back_applications_spec.rb +61 -0
  45. data/spec/engineyard-serverside/cli/workflows/showing_maintenance_status_spec.rb +60 -0
  46. data/spec/engineyard-serverside/cli/workflows_spec.rb +87 -0
  47. data/spec/engineyard-serverside/dependency_manager/base_spec.rb +139 -0
  48. data/spec/engineyard-serverside/paths_spec.rb +820 -0
  49. data/spec/engineyard-serverside/propagator_spec.rb +56 -0
  50. data/spec/engineyard-serverside/server_spec.rb +390 -0
  51. data/spec/engineyard-serverside/shell/helpers_spec.rb +98 -0
  52. data/spec/engineyard-serverside/shell/yieldio_spec.rb +33 -0
  53. data/spec/engineyard-serverside/shell_spec.rb +543 -0
  54. data/spec/engineyard-serverside/slug/distributor_spec.rb +199 -0
  55. data/spec/engineyard-serverside/slug/enabler_spec.rb +191 -0
  56. data/spec/engineyard-serverside/slug/failure_handler_spec.rb +114 -0
  57. data/spec/engineyard-serverside/slug/finalizer_spec.rb +191 -0
  58. data/spec/engineyard-serverside/slug/generator_spec.rb +82 -0
  59. data/spec/engineyard-serverside/slug/migrator_spec.rb +137 -0
  60. data/spec/engineyard-serverside/slug/restarter_spec.rb +226 -0
  61. data/spec/engineyard-serverside/slug/source/updater_spec.rb +710 -0
  62. data/spec/engineyard-serverside/slug/source_spec.rb +40 -0
  63. data/spec/engineyard-serverside/source_spec.rb +171 -0
  64. data/spec/railway_spec.rb +130 -0
  65. data/spec/result/failure_spec.rb +113 -0
  66. data/spec/result/success_spec.rb +109 -0
  67. data/spec/result_spec.rb +23 -0
  68. data/spec/spec_helper.rb +3 -349
  69. metadata +327 -602
  70. data/lib/vendor/json_pure/COPYING +0 -57
  71. data/lib/vendor/json_pure/GPL +0 -340
  72. data/lib/vendor/json_pure/README.rdoc +0 -358
  73. data/lib/vendor/json_pure/VERSION +0 -1
  74. data/lib/vendor/json_pure/lib/json.rb +0 -62
  75. data/lib/vendor/json_pure/lib/json/add/bigdecimal.rb +0 -28
  76. data/lib/vendor/json_pure/lib/json/add/complex.rb +0 -22
  77. data/lib/vendor/json_pure/lib/json/add/core.rb +0 -11
  78. data/lib/vendor/json_pure/lib/json/add/date.rb +0 -34
  79. data/lib/vendor/json_pure/lib/json/add/date_time.rb +0 -48
  80. data/lib/vendor/json_pure/lib/json/add/exception.rb +0 -31
  81. data/lib/vendor/json_pure/lib/json/add/ostruct.rb +0 -31
  82. data/lib/vendor/json_pure/lib/json/add/range.rb +0 -29
  83. data/lib/vendor/json_pure/lib/json/add/rational.rb +0 -22
  84. data/lib/vendor/json_pure/lib/json/add/regexp.rb +0 -30
  85. data/lib/vendor/json_pure/lib/json/add/struct.rb +0 -30
  86. data/lib/vendor/json_pure/lib/json/add/symbol.rb +0 -25
  87. data/lib/vendor/json_pure/lib/json/add/time.rb +0 -38
  88. data/lib/vendor/json_pure/lib/json/common.rb +0 -484
  89. data/lib/vendor/json_pure/lib/json/ext.rb +0 -21
  90. data/lib/vendor/json_pure/lib/json/generic_object.rb +0 -70
  91. data/lib/vendor/json_pure/lib/json/pure.rb +0 -21
  92. data/lib/vendor/json_pure/lib/json/pure/generator.rb +0 -522
  93. data/lib/vendor/json_pure/lib/json/pure/parser.rb +0 -359
  94. data/lib/vendor/json_pure/lib/json/version.rb +0 -8
  95. data/lib/vendor/multi_json/CHANGELOG.md +0 -121
  96. data/lib/vendor/multi_json/CONTRIBUTING.md +0 -46
  97. data/lib/vendor/multi_json/Gemfile +0 -31
  98. data/lib/vendor/multi_json/LICENSE.md +0 -20
  99. data/lib/vendor/multi_json/README.md +0 -105
  100. data/lib/vendor/multi_json/Rakefile +0 -12
  101. data/lib/vendor/multi_json/lib/multi_json.rb +0 -137
  102. data/lib/vendor/multi_json/lib/multi_json/adapters/gson.rb +0 -20
  103. data/lib/vendor/multi_json/lib/multi_json/adapters/json_common.rb +0 -35
  104. data/lib/vendor/multi_json/lib/multi_json/adapters/json_gem.rb +0 -12
  105. data/lib/vendor/multi_json/lib/multi_json/adapters/json_pure.rb +0 -12
  106. data/lib/vendor/multi_json/lib/multi_json/adapters/nsjsonserialization.rb +0 -35
  107. data/lib/vendor/multi_json/lib/multi_json/adapters/oj.rb +0 -29
  108. data/lib/vendor/multi_json/lib/multi_json/adapters/ok_json.rb +0 -58
  109. data/lib/vendor/multi_json/lib/multi_json/adapters/yajl.rb +0 -20
  110. data/lib/vendor/multi_json/lib/multi_json/vendor/okjson.rb +0 -602
  111. data/lib/vendor/multi_json/lib/multi_json/version.rb +0 -3
  112. data/lib/vendor/multi_json/spec/adapter_shared_example.rb +0 -162
  113. data/lib/vendor/multi_json/spec/helper.rb +0 -45
  114. data/lib/vendor/multi_json/spec/json_common_shared_example.rb +0 -36
  115. data/lib/vendor/multi_json/spec/multi_json_spec.rb +0 -151
  116. data/spec/archive_deploy_spec.rb +0 -53
  117. data/spec/basic_deploy_spec.rb +0 -26
  118. data/spec/bundler_deploy_spec.rb +0 -160
  119. data/spec/configuration_spec.rb +0 -206
  120. data/spec/custom_deploy_spec.rb +0 -128
  121. data/spec/deploy_hook_spec.rb +0 -378
  122. data/spec/deprecation_spec.rb +0 -23
  123. data/spec/ey_yml_customized_deploy_spec.rb +0 -99
  124. data/spec/fixtures/gitrepo.tar.gz +0 -0
  125. data/spec/fixtures/invalid_hook.rb +0 -1
  126. data/spec/fixtures/lockfiles/0.9-no-bundler +0 -111
  127. data/spec/fixtures/lockfiles/0.9-with-bundler +0 -117
  128. data/spec/fixtures/lockfiles/1.0-no-bundler +0 -54
  129. data/spec/fixtures/lockfiles/1.0.0.rc.1-with-bundler +0 -162
  130. data/spec/fixtures/lockfiles/1.0.18-do_mysql +0 -88
  131. data/spec/fixtures/lockfiles/1.0.18-do_postgres +0 -79
  132. data/spec/fixtures/lockfiles/1.0.18-mysql +0 -43
  133. data/spec/fixtures/lockfiles/1.0.18-mysql2 +0 -43
  134. data/spec/fixtures/lockfiles/1.0.18-pg +0 -43
  135. data/spec/fixtures/lockfiles/1.0.6-no-bundler +0 -51
  136. data/spec/fixtures/lockfiles/1.0.6-with-any-bundler +0 -52
  137. data/spec/fixtures/lockfiles/1.0.6-with-bundler +0 -52
  138. data/spec/fixtures/lockfiles/1.15.1-no-bundler +0 -51
  139. data/spec/fixtures/lockfiles/1.3.1-rails-3.2.13 +0 -112
  140. data/spec/fixtures/lockfiles/not-a-lockfile +0 -1
  141. data/spec/fixtures/repos/assets_detected/Gemfile +0 -5
  142. data/spec/fixtures/repos/assets_detected/Gemfile.lock +0 -88
  143. data/spec/fixtures/repos/assets_detected/README +0 -1
  144. data/spec/fixtures/repos/assets_detected/Rakefile +0 -5
  145. data/spec/fixtures/repos/assets_detected/app/assets/empty +0 -0
  146. data/spec/fixtures/repos/assets_detected/config/application.rb +0 -5
  147. data/spec/fixtures/repos/assets_detected/config/ey.yml +0 -3
  148. data/spec/fixtures/repos/assets_disabled/Gemfile +0 -5
  149. data/spec/fixtures/repos/assets_disabled/Gemfile.lock +0 -88
  150. data/spec/fixtures/repos/assets_disabled/README +0 -1
  151. data/spec/fixtures/repos/assets_disabled/Rakefile +0 -6
  152. data/spec/fixtures/repos/assets_disabled/app/assets/empty +0 -0
  153. data/spec/fixtures/repos/assets_disabled/config/application.rb +0 -5
  154. data/spec/fixtures/repos/assets_disabled/config/ey.yml +0 -3
  155. data/spec/fixtures/repos/assets_disabled_in_ey_yml/Gemfile +0 -5
  156. data/spec/fixtures/repos/assets_disabled_in_ey_yml/Gemfile.lock +0 -88
  157. data/spec/fixtures/repos/assets_disabled_in_ey_yml/README +0 -1
  158. data/spec/fixtures/repos/assets_disabled_in_ey_yml/Rakefile +0 -6
  159. data/spec/fixtures/repos/assets_disabled_in_ey_yml/app/assets/empty +0 -0
  160. data/spec/fixtures/repos/assets_disabled_in_ey_yml/config/application.rb +0 -5
  161. data/spec/fixtures/repos/assets_disabled_in_ey_yml/config/ey.yml +0 -5
  162. data/spec/fixtures/repos/assets_disabled_utf8/Gemfile +0 -5
  163. data/spec/fixtures/repos/assets_disabled_utf8/Gemfile.lock +0 -88
  164. data/spec/fixtures/repos/assets_disabled_utf8/README +0 -3
  165. data/spec/fixtures/repos/assets_disabled_utf8/Rakefile +0 -5
  166. data/spec/fixtures/repos/assets_disabled_utf8/app/assets/empty +0 -0
  167. data/spec/fixtures/repos/assets_disabled_utf8/config/application.rb +0 -7
  168. data/spec/fixtures/repos/assets_disabled_utf8/config/ey.yml +0 -3
  169. data/spec/fixtures/repos/assets_enabled_all/Gemfile +0 -5
  170. data/spec/fixtures/repos/assets_enabled_all/Gemfile.lock +0 -88
  171. data/spec/fixtures/repos/assets_enabled_all/README +0 -1
  172. data/spec/fixtures/repos/assets_enabled_all/app/assets/empty +0 -0
  173. data/spec/fixtures/repos/assets_enabled_all/config/application.rb +0 -5
  174. data/spec/fixtures/repos/assets_enabled_all/config/ey.yml +0 -6
  175. data/spec/fixtures/repos/assets_enabled_all/script/assets +0 -5
  176. data/spec/fixtures/repos/assets_enabled_all/tmp/obstruction +0 -1
  177. data/spec/fixtures/repos/assets_enabled_in_ey_yml/Gemfile +0 -3
  178. data/spec/fixtures/repos/assets_enabled_in_ey_yml/Gemfile.lock +0 -10
  179. data/spec/fixtures/repos/assets_enabled_in_ey_yml/README +0 -1
  180. data/spec/fixtures/repos/assets_enabled_in_ey_yml/Rakefile +0 -8
  181. data/spec/fixtures/repos/assets_enabled_in_ey_yml/config/ey.yml +0 -4
  182. data/spec/fixtures/repos/assets_enabled_util_only/Gemfile +0 -5
  183. data/spec/fixtures/repos/assets_enabled_util_only/Gemfile.lock +0 -88
  184. data/spec/fixtures/repos/assets_enabled_util_only/README +0 -1
  185. data/spec/fixtures/repos/assets_enabled_util_only/Rakefile +0 -6
  186. data/spec/fixtures/repos/assets_enabled_util_only/app/assets/empty +0 -0
  187. data/spec/fixtures/repos/assets_enabled_util_only/config/application.rb +0 -5
  188. data/spec/fixtures/repos/assets_enabled_util_only/config/ey.yml +0 -6
  189. data/spec/fixtures/repos/assets_error/Gemfile +0 -5
  190. data/spec/fixtures/repos/assets_error/Gemfile.lock +0 -88
  191. data/spec/fixtures/repos/assets_error/README +0 -1
  192. data/spec/fixtures/repos/assets_error/Rakefile +0 -4
  193. data/spec/fixtures/repos/assets_error/app/assets/empty +0 -0
  194. data/spec/fixtures/repos/assets_error/config/application.rb +0 -5
  195. data/spec/fixtures/repos/assets_error/config/ey.yml +0 -4
  196. data/spec/fixtures/repos/assets_in_hook/Gemfile +0 -5
  197. data/spec/fixtures/repos/assets_in_hook/Gemfile.lock +0 -88
  198. data/spec/fixtures/repos/assets_in_hook/README +0 -2
  199. data/spec/fixtures/repos/assets_in_hook/Rakefile +0 -5
  200. data/spec/fixtures/repos/assets_in_hook/app/assets/empty +0 -0
  201. data/spec/fixtures/repos/assets_in_hook/config/application.rb +0 -5
  202. data/spec/fixtures/repos/assets_in_hook/config/ey.yml +0 -3
  203. data/spec/fixtures/repos/assets_in_hook/deploy/before_compile_assets.rb +0 -2
  204. data/spec/fixtures/repos/bundle_fails/Gemfile +0 -1
  205. data/spec/fixtures/repos/bundle_fails/README +0 -1
  206. data/spec/fixtures/repos/bundle_fails/deploy/after_bundle.rb +0 -1
  207. data/spec/fixtures/repos/bundler_disabled/Gemfile +0 -4
  208. data/spec/fixtures/repos/bundler_disabled/Gemfile.lock +0 -12
  209. data/spec/fixtures/repos/bundler_disabled/README +0 -1
  210. data/spec/fixtures/repos/bundler_disabled/config/ey.yml +0 -2
  211. data/spec/fixtures/repos/bundler_disabled/deploy/after_bundle.rb +0 -1
  212. data/spec/fixtures/repos/bundler_disabled/deploy/before_bundle.rb +0 -1
  213. data/spec/fixtures/repos/bundler_old/Gemfile +0 -5
  214. data/spec/fixtures/repos/bundler_old/Gemfile.lock +0 -15
  215. data/spec/fixtures/repos/bundler_old/README +0 -1
  216. data/spec/fixtures/repos/default/Gemfile +0 -4
  217. data/spec/fixtures/repos/default/Gemfile.lock +0 -12
  218. data/spec/fixtures/repos/default/README +0 -5
  219. data/spec/fixtures/repos/default/ey.yml +0 -3
  220. data/spec/fixtures/repos/executable_hooks/README +0 -1
  221. data/spec/fixtures/repos/executable_hooks/deploy/before_restart +0 -72
  222. data/spec/fixtures/repos/executable_hooks_not_executable/README +0 -3
  223. data/spec/fixtures/repos/executable_hooks_not_executable/deploy/before_restart +0 -3
  224. data/spec/fixtures/repos/ey_yml/Gemfile +0 -4
  225. data/spec/fixtures/repos/ey_yml/Gemfile.lock +0 -12
  226. data/spec/fixtures/repos/ey_yml/README +0 -1
  227. data/spec/fixtures/repos/ey_yml/config/ey.yml +0 -18
  228. data/spec/fixtures/repos/ey_yml/deploy/before_migrate.rb +0 -6
  229. data/spec/fixtures/repos/ey_yml_alt/Gemfile +0 -4
  230. data/spec/fixtures/repos/ey_yml_alt/Gemfile.lock +0 -12
  231. data/spec/fixtures/repos/ey_yml_alt/README +0 -1
  232. data/spec/fixtures/repos/ey_yml_alt/deploy/before_migrate.rb +0 -6
  233. data/spec/fixtures/repos/ey_yml_alt/ey.yml +0 -12
  234. data/spec/fixtures/repos/hook_fails/README +0 -1
  235. data/spec/fixtures/repos/hook_fails/deploy/before_deploy.rb +0 -1
  236. data/spec/fixtures/repos/hooks/README +0 -1
  237. data/spec/fixtures/repos/hooks/deploy/after_bundle.rb +0 -1
  238. data/spec/fixtures/repos/hooks/deploy/after_compile_assets.rb +0 -1
  239. data/spec/fixtures/repos/hooks/deploy/after_deploy.rb +0 -1
  240. data/spec/fixtures/repos/hooks/deploy/after_migrate.rb +0 -1
  241. data/spec/fixtures/repos/hooks/deploy/after_restart.rb +0 -1
  242. data/spec/fixtures/repos/hooks/deploy/after_symlink.rb +0 -1
  243. data/spec/fixtures/repos/hooks/deploy/before_bundle.rb +0 -1
  244. data/spec/fixtures/repos/hooks/deploy/before_compile_assets.rb +0 -1
  245. data/spec/fixtures/repos/hooks/deploy/before_deploy.rb +0 -1
  246. data/spec/fixtures/repos/hooks/deploy/before_migrate.rb +0 -1
  247. data/spec/fixtures/repos/hooks/deploy/before_restart.rb +0 -1
  248. data/spec/fixtures/repos/hooks/deploy/before_symlink.rb +0 -1
  249. data/spec/fixtures/repos/multi_dep_manager/README +0 -1
  250. data/spec/fixtures/repos/multi_dep_manager/composer.json +0 -5
  251. data/spec/fixtures/repos/multi_dep_manager/composer.lock +0 -462
  252. data/spec/fixtures/repos/multi_dep_manager/package.json +0 -7
  253. data/spec/fixtures/repos/multi_dep_manager/public/index.php +0 -4
  254. data/spec/fixtures/repos/no_ey_config/Gemfile +0 -3
  255. data/spec/fixtures/repos/no_ey_config/Gemfile.lock +0 -10
  256. data/spec/fixtures/repos/no_ey_config/README +0 -1
  257. data/spec/fixtures/repos/no_ey_config/ey.yml +0 -3
  258. data/spec/fixtures/repos/no_ey_config_no_warning/Gemfile +0 -3
  259. data/spec/fixtures/repos/no_ey_config_no_warning/Gemfile.lock +0 -10
  260. data/spec/fixtures/repos/no_ey_config_no_warning/README +0 -1
  261. data/spec/fixtures/repos/no_ey_config_no_warning/ey.yml +0 -5
  262. data/spec/fixtures/repos/no_gemfile_lock/Gemfile +0 -4
  263. data/spec/fixtures/repos/no_gemfile_lock/README +0 -1
  264. data/spec/fixtures/repos/no_gemfile_lock/ey.yml +0 -3
  265. data/spec/fixtures/repos/nodejs/README +0 -1
  266. data/spec/fixtures/repos/nodejs/package.json +0 -7
  267. data/spec/fixtures/repos/not_bundled/README +0 -1
  268. data/spec/fixtures/repos/npm_disabled/README +0 -1
  269. data/spec/fixtures/repos/npm_disabled/config/ey.yml +0 -2
  270. data/spec/fixtures/repos/npm_disabled/package.json +0 -7
  271. data/spec/fixtures/repos/php_composer_disabled/README +0 -1
  272. data/spec/fixtures/repos/php_composer_disabled/composer.json +0 -5
  273. data/spec/fixtures/repos/php_composer_disabled/composer.lock +0 -462
  274. data/spec/fixtures/repos/php_composer_disabled/config/ey.yml +0 -2
  275. data/spec/fixtures/repos/php_composer_disabled/public/index.php +0 -4
  276. data/spec/fixtures/repos/php_composer_lock/README +0 -1
  277. data/spec/fixtures/repos/php_composer_lock/composer.json +0 -5
  278. data/spec/fixtures/repos/php_composer_lock/composer.lock +0 -462
  279. data/spec/fixtures/repos/php_composer_lock/public/index.php +0 -4
  280. data/spec/fixtures/repos/php_no_composer_lock/README +0 -1
  281. data/spec/fixtures/repos/php_no_composer_lock/composer.json +0 -21
  282. data/spec/fixtures/repos/php_no_composer_lock/public/index.php +0 -4
  283. data/spec/fixtures/repos/public_system/Gemfile +0 -4
  284. data/spec/fixtures/repos/public_system/Gemfile.lock +0 -12
  285. data/spec/fixtures/repos/public_system/README +0 -5
  286. data/spec/fixtures/repos/public_system/ey.yml +0 -3
  287. data/spec/fixtures/repos/public_system/public/system/cant_touch_this.txt +0 -3
  288. data/spec/fixtures/repos/sqlite3/Gemfile +0 -4
  289. data/spec/fixtures/repos/sqlite3/Gemfile.lock +0 -89
  290. data/spec/fixtures/repos/sqlite3/README +0 -1
  291. data/spec/fixtures/retwisj.war +0 -0
  292. data/spec/fixtures/valid_hook.rb +0 -1
  293. data/spec/git_strategy_spec.rb +0 -34
  294. data/spec/lockfile_parser_spec.rb +0 -126
  295. data/spec/maintenance_spec.rb +0 -44
  296. data/spec/multi_dependency_manager_spec.rb +0 -25
  297. data/spec/nodejs_deploy_spec.rb +0 -30
  298. data/spec/php_deploy_spec.rb +0 -81
  299. data/spec/platform_configure_spec.rb +0 -61
  300. data/spec/rails31_deploy_spec.rb +0 -172
  301. data/spec/restart_spec.rb +0 -43
  302. data/spec/rollback_spec.rb +0 -87
  303. data/spec/server_spec.rb +0 -70
  304. data/spec/services_deploy_spec.rb +0 -165
  305. data/spec/shell_spec.rb +0 -57
  306. data/spec/source/archive_spec.rb +0 -33
  307. data/spec/source/git_spec.rb +0 -44
  308. data/spec/sqlite3_deploy_spec.rb +0 -38
  309. data/spec/support/integration.rb +0 -103
  310. data/spec/support/source_doubles.rb +0 -28
  311. data/spec/support/timecop.rb +0 -5
  312. data/spec/symlink_spec.rb +0 -15
@@ -1,26 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Deploying a simple application" do
4
- before(:all) do
5
- deploy_test_application('not_bundled')
6
- end
7
-
8
- it "creates a REVISION file" do
9
- expect(deploy_dir.join('current', 'REVISION')).to exist
10
- end
11
-
12
- it "restarts the app servers" do
13
- restart = deploy_dir.join('current', 'restart')
14
- expect(restart).to exist
15
- expect(restart.read.chomp).to eq(%|LANG="en_US.UTF-8" /engineyard/bin/app_rails31 deploy|)
16
- end
17
-
18
- it "reuses the same active_release directory if a release_path is specified (such as in integrate)" do
19
- path = @config.paths.active_release
20
- expect(path.parent.children.size).to eq(1)
21
-
22
- redeploy_test_application('config' => {'release_path' => path.to_s})
23
-
24
- expect(path.parent.children.size).to eq(1)
25
- end
26
- end
@@ -1,160 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Deploying an application that uses Bundler" do
4
- VERSION_PATTERN = Regexp.quote(::EY::Serverside::DependencyManager::Bundler.default_version)
5
- PARALLEL_JOBS = ::EY::Serverside::DependencyManager::Bundler.jobs_number
6
-
7
- context "with a Gemfile.lock" do
8
- before(:all) do
9
- deploy_test_application('ey_yml')
10
- @install_bundler_command = @deployer.commands.grep(/gem install bundler/).first
11
- @bundle_install_command = @deployer.commands.grep(/bundle _#{VERSION_PATTERN}_ install/).first
12
- end
13
-
14
- it "runs the right bundler command" do
15
- expect(@install_bundler_command).not_to be_nil
16
- expect(@install_bundler_command).to match(/install bundler .* -v "#{VERSION_PATTERN}"/)
17
- end
18
-
19
- it "runs 'bundle install' with --deployment" do
20
- expect(@bundle_install_command).not_to be_nil
21
- expect(@bundle_install_command).to include('--deployment')
22
- end
23
-
24
- it "runs 'bundle install' with --jobs #{PARALLEL_JOBS}" do
25
- expect(@bundle_install_command).not_to be_nil
26
- expect(@bundle_install_command).to include("--jobs #{PARALLEL_JOBS}")
27
- end
28
-
29
- it "removes bundled_gems directory if the ruby or system version changed" do
30
- should_run_clear_bundle_cmd = @deployer.commands.grep(/diff/).first
31
- expect(should_run_clear_bundle_cmd).not_to be_nil
32
- clear_bundle_cmd = @deployer.commands.grep(/rm -Rf \S+\/bundled_gems/).first
33
- expect(clear_bundle_cmd).not_to be_nil
34
- end
35
-
36
- it "has the binstubs in the path when migrating" do
37
- expect(deploy_dir.join('path-when-migrating').read).to include('ey_bundler_binstubs')
38
- end
39
-
40
- it "creates a ruby version file" do
41
- expect(deploy_dir.join('shared', 'bundled_gems', 'RUBY_VERSION')).to exist
42
- end
43
-
44
- it "creates a system version file" do
45
- expect(deploy_dir.join('shared', 'bundled_gems', 'SYSTEM_VERSION')).to exist
46
- end
47
-
48
- it "generates bundler binstubs" do
49
- pending "doesn't work with mocked bundler"
50
- expect(deploy_dir.join('current', 'ey_bundler_binstubs', 'rake')).to exist
51
- end
52
- end
53
-
54
- context "with clean option" do
55
- before(:all) do
56
- deploy_test_application('ey_yml', 'clean' => true)
57
- end
58
-
59
- it "removes bundled_gems directory if the ruby or system version changed" do
60
- should_run_clear_bundle_cmd = @deployer.commands.grep(/diff/).first
61
- expect(should_run_clear_bundle_cmd).to be_nil
62
- clear_bundle_cmd = @deployer.commands.grep(/rm -Rf \S+\/bundled_gems/).first
63
- expect(clear_bundle_cmd).not_to be_nil
64
- end
65
-
66
- end
67
-
68
- context "with bundler disabled in ey.yml" do
69
- before(:all) do
70
- deploy_test_application('bundler_disabled')
71
- end
72
-
73
- it "does not run bundler commands" do
74
- expect(@deployer.commands.grep(/gem install bundler/)).to be_empty
75
- expect(@deployer.commands.grep(/bundle _.*_ install/)).to be_empty
76
- end
77
-
78
- it "still runs the hooks" do
79
- expect(deploy_dir.join('current', 'before_bundle.ran' )).to exist
80
- expect(deploy_dir.join('current', 'after_bundle.ran' )).to exist
81
- end
82
- end
83
-
84
- context "without a Gemfile.lock" do
85
- before(:all) do
86
- deploy_test_application('no_gemfile_lock')
87
- @install_bundler_command = @deployer.commands.grep(/gem install bundler/).first
88
- @bundle_install_command = @deployer.commands.grep(/bundle _#{VERSION_PATTERN}_ install/).first
89
- end
90
-
91
- it "installs the proper Bundler version" do
92
- expect(@install_bundler_command).not_to be_nil
93
- expect(@install_bundler_command).to match(/unset RUBYOPT && gem list bundler | grep "bundler " | egrep -q "#{VERSION_PATTERN}[,)]" || gem install bundler -q --no-rdoc --no-ri -v "#{VERSION_PATTERN}"/)
94
- end
95
-
96
- it "runs 'bundle install' without --deployment" do
97
- expect(@bundle_install_command).not_to be_nil
98
- expect(@bundle_install_command).not_to match(/--deployment/)
99
- end
100
-
101
- it "runs 'bundle install' with --jobs #{PARALLEL_JOBS}" do
102
- expect(@bundle_install_command).not_to be_nil
103
- expect(@bundle_install_command).to include("--jobs #{PARALLEL_JOBS}")
104
- end
105
-
106
- it "exports GIT_SSH for the bundle install" do
107
- expect(@bundle_install_command).to match(/export GIT_SSH/)
108
- end
109
-
110
- it "puts down RUBY_VERSION and SYSTEM_VERSION" do
111
- expect(deploy_dir.join('shared', 'bundled_gems', 'RUBY_VERSION')).to exist
112
- expect(deploy_dir.join('shared', 'bundled_gems', 'SYSTEM_VERSION')).to exist
113
- end
114
-
115
- it "warns that using a lockfile is idiomatic" do
116
- out = read_output
117
- expect(out).to match(/WARNING: Gemfile found but Gemfile.lock is missing!/)
118
- end
119
- end
120
-
121
- context "without a Gemfile.lock and ignoring the warning" do
122
- before(:all) do
123
- deploy_test_application('no_gemfile_lock', 'config' => {'ignore_gemfile_lock_warning' => true})
124
- expect(@config.ignore_gemfile_lock_warning).to be_truthy
125
- @install_bundler_command = @deployer.commands.grep(/gem install bundler/).first
126
- @bundle_install_command = @deployer.commands.grep(/bundle _#{VERSION_PATTERN}_ install/).first
127
- end
128
-
129
- it "should not warn" do
130
- out = read_output
131
- expect(out).not_to match(/WARNING/)
132
- end
133
- end
134
-
135
- context "with a failing Gemfile" do
136
- before(:all) do
137
- begin
138
- deploy_test_application('bundle_fails', 'bundle_install_fails' => true, 'verbose' => false)
139
- rescue EY::Serverside::RemoteFailure
140
- end
141
- end
142
-
143
- it "prints the failure to the log" do
144
- out = read_output
145
- expect(out).to match(%r|bundle install failure|)
146
- expect(deploy_dir.join('current', 'after_bundle.ran' )).not_to exist
147
- end
148
- end
149
-
150
- context "with outdated bundler" do
151
- before :all do
152
- deploy_test_application( "bundler_old" )
153
- @bundle_install_command = @deployer.commands.grep( /bundle _1.3.6_ install/ ).first
154
- end
155
-
156
- it "doesn't run 'bundle install' with --jobs" do
157
- expect( @bundle_install_command ).to_not include "--jobs"
158
- end
159
- end
160
- end
@@ -1,206 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe EY::Serverside::Deploy::Configuration do
4
- describe "default options" do
5
- it "has defaults" do
6
- @config = EY::Serverside::Deploy::Configuration.new({
7
- 'app' => 'app_name',
8
- 'environment_name' => 'env_name',
9
- 'account_name' => 'acc',
10
- 'framework_env' => 'production',
11
- })
12
- expect(@config.app_name).to eq("app_name")
13
- expect(@config.environment_name).to eq("env_name")
14
- expect(@config.account_name).to eq("acc")
15
- expect(@config.migrate).to eq(nil)
16
- expect(@config.migrate?).to eq(false)
17
- expect(@config.branch).to eq("master")
18
- expect(@config.ref).to eq("master")
19
- expect(@config.maintenance_on_migrate).to eq(true)
20
- expect(@config.maintenance_on_restart).to eq(true)
21
- expect(@config.required_downtime_stack?).to eq(true)
22
- expect(@config.framework_env).to eq("production")
23
- expect(@config.precompile_assets).to eq("detect")
24
- expect(@config.precompile_assets_inferred?).to eq(true)
25
- expect(@config.skip_precompile_assets?).to eq(false)
26
- expect(@config.precompile_assets?).to eq(false)
27
- expect(@config.asset_roles).to eq([:app_master, :app, :solo])
28
- expect(@config.user).to eq(ENV['USER'])
29
- expect(@config.group).to eq(ENV['USER'])
30
- expect(@config.verbose).to eq(false)
31
- expect(@config.copy_exclude).to eq([])
32
- expect(@config.ignore_database_adapter_warning).to eq(false)
33
- expect(@config.ignore_ey_config_warning).to eq(false)
34
- expect(@config.ignore_gemfile_lock_warning).to eq(false)
35
- expect(@config.bundle_without).to eq(%w[test development])
36
- expect(@config.extra_bundle_install_options).to eq(%w[--without test development])
37
- expect(@config.deployed_by).to eq("Automation (User name not available)")
38
- expect(@config.input_ref).to eq(@config.branch)
39
- expect(@config.keep_releases).to eq(3)
40
- expect(@config.keep_failed_releases).to eq(3)
41
- end
42
-
43
- it "raises when required options are not given" do
44
- @config = EY::Serverside::Deploy::Configuration.new({})
45
- expect { @config.app_name }.to raise_error
46
- expect { @config.environment_name }.to raise_error
47
- expect { @config.account_name }.to raise_error
48
- expect { @config.framework_env }.to raise_error
49
- end
50
- end
51
-
52
- context "strategies" do
53
- let(:options) do
54
- { "app" => "serverside" }
55
- end
56
-
57
- it "uses strategy if set" do
58
- @config = EY::Serverside::Deploy::Configuration.new(
59
- options.merge({'strategy' => 'IntegrationSpec', 'git' => 'git@github.com:engineyard/todo.git'})
60
- )
61
- capture do # deprecation warning
62
- expect(@config.source(test_shell)).to be_a_kind_of(EY::Serverside::Source::IntegrationSpec)
63
- end
64
- expect(read_output).to include("DEPRECATION WARNING: The configuration key 'strategy' is deprecated in favor of 'source_class'.")
65
- end
66
-
67
- it "uses source_class if set" do
68
- @config = EY::Serverside::Deploy::Configuration.new(
69
- options.merge({'source_class' => 'IntegrationSpec', 'git' => 'git@github.com:engineyard/todo.git'})
70
- )
71
- expect(@config.source(test_shell)).to be_a_kind_of(EY::Serverside::Source::IntegrationSpec)
72
- end
73
-
74
- it "infers a git source" do
75
- @config = EY::Serverside::Deploy::Configuration.new(
76
- options.merge({ 'git' => 'git@github.com:engineyard/todo.git' })
77
- )
78
- expect(@config.source(test_shell)).to be_a_kind_of(EY::Serverside::Source::Git)
79
- end
80
-
81
- it "infers a archive source" do
82
- @config = EY::Serverside::Deploy::Configuration.new(
83
- options.merge({'archive' => 'https://github.com/engineyard/todo/archive/master.zip'})
84
- )
85
-
86
- expect(@config.source(test_shell)).to be_a_kind_of(EY::Serverside::Source::Archive)
87
- end
88
- end
89
-
90
- context "command line options" do
91
- before do
92
- @config = EY::Serverside::Deploy::Configuration.new({
93
- 'repository_cache' => @tempdir,
94
- 'app' => 'app_name',
95
- 'stack' => 'nginx_passenger',
96
- 'framework_env' => 'development',
97
- 'environment_name' => 'env_name',
98
- 'account_name' => 'acc',
99
- 'branch' => 'branch_from_command_line',
100
- 'config' => MultiJson.dump({'custom' => 'custom_from_extra_config', 'maintenance_on_migrate' => 'false', 'precompile_assets' => 'false', 'deployed_by' => 'Martin Emde', 'input_ref' => 'input_branch'})
101
- })
102
- end
103
-
104
- it "underrides options with config (directly supplied options take precedence over 'config' options)" do
105
- expect(@config.maintenance_on_migrate).to eq(false)
106
- expect(@config.branch).to eq("branch_from_command_line")
107
- end
108
-
109
- it "corrects command line supplied precompile_assets string (which relies on having a special not-set value of nil, so can't be a boolean)" do
110
- expect(@config.skip_precompile_assets?).to eq(true)
111
- expect(@config.precompile_assets?).to eq(false)
112
- expect(@config.precompile_assets_inferred?).to eq(false)
113
- end
114
-
115
- it "doesn't require downtime on restart for nginx_passenger" do
116
- expect(@config.maintenance_on_migrate).to eq(false)
117
- expect(@config.maintenance_on_restart).to eq(false)
118
- end
119
-
120
- it "doesn't bundle --without the framework_env" do
121
- expect(@config.bundle_without).to eq(%w[test])
122
- end
123
-
124
- it "gets deployed_by and input_ref correct" do
125
- expect(@config.deployed_by).to eq("Martin Emde")
126
- expect(@config.input_ref).to eq("input_branch")
127
- end
128
- end
129
-
130
- describe "ey.yml loading" do
131
- before(:each) do
132
- @tempdir = `mktemp -d -t ey_yml_spec.XXXXX`.strip
133
- @config = EY::Serverside::Deploy::Configuration.new({
134
- 'repository_cache' => @tempdir,
135
- 'app' => 'app_name',
136
- 'environment_name' => 'env_name',
137
- 'account_name' => 'acc',
138
- 'migrate' => nil,
139
- 'branch' => 'branch_from_command_line',
140
- 'config' => MultiJson.dump({'custom' => 'custom_from_extra_config', 'maintenance_on_migrate' => 'false'})
141
- })
142
-
143
- @deploy = FullTestDeploy.new(test_servers, @config, test_shell)
144
-
145
- @yaml_data = {
146
- 'environments' => {
147
- 'env_name' => {
148
- 'copy_exclude' => ['.git'],
149
- 'migrate' => true,
150
- 'migration_command' => 'uh oh',
151
- 'branch' => 'branch_from_ey_yml',
152
- 'custom' => 'custom_from_ey_yml',
153
- 'bundle_without' => 'only test',
154
- 'maintenance_on_migrate' => true,
155
- }
156
- }
157
- }
158
- end
159
-
160
- def write_ey_yml(relative_path, data)
161
- FileUtils.mkdir_p(File.join(
162
- @tempdir,
163
- File.dirname(relative_path)))
164
-
165
- File.open(File.join(@tempdir, relative_path), 'w') do |f|
166
- f.write data.to_yaml
167
- end
168
- end
169
-
170
- it "requires 'ey.yml' and adds any defined methods to the deploy" do
171
- write_ey_yml 'ey.yml', @yaml_data
172
- @deploy.load_ey_yml
173
- expect(@deploy.config.copy_exclude).to eq(['.git'])
174
- end
175
-
176
- it "falls back to 'config/ey.yml'" do
177
- write_ey_yml 'config/ey.yml', @yaml_data
178
- @deploy.load_ey_yml
179
- expect(@deploy.config.copy_exclude).to eq(['.git'])
180
- end
181
-
182
- it "loads at lower priority than command line options" do
183
- write_ey_yml 'ey.yml', @yaml_data
184
- @deploy.load_ey_yml
185
- expect(@deploy.config.migrate?).to eq(false)
186
- end
187
-
188
- it "loads at lower priority than json config option" do
189
- write_ey_yml 'ey.yml', @yaml_data
190
- @deploy.load_ey_yml
191
- expect(@deploy.config.branch).to eq('branch_from_command_line')
192
- end
193
-
194
- it "loads bundle_without from the config, which overrides the default" do
195
- write_ey_yml 'ey.yml', @yaml_data
196
- @deploy.load_ey_yml
197
- expect(@deploy.config.bundle_without).to eq('only test')
198
- end
199
-
200
- it "overrides boolean ey.yml only options with --conifg strings" do
201
- write_ey_yml 'ey.yml', @yaml_data
202
- @deploy.load_ey_yml
203
- expect(@deploy.config).not_to be_maintenance_on_migrate
204
- end
205
- end
206
- end
@@ -1,128 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "the EY::Serverside::Deploy API" do
4
- it "calls tasks in the right order" do
5
- class TestDeploy < FullTestDeploy
6
- attr_reader :call_order
7
- def initialize(*a)
8
- super
9
- @call_order = []
10
- end
11
-
12
- def push_code() @call_order << 'push_code' ; super end
13
- def copy_repository_cache() @call_order << 'copy_repository_cache' ; super end
14
- def create_revision_file() @call_order << 'create_revision_file' ; super end
15
- def bundle() @call_order << 'bundle' ; super end
16
- def setup_services() @call_order << 'setup_services' ; super end
17
- def symlink_configs() @call_order << 'symlink_configs' ; super end
18
- def migrate() @call_order << 'migrate' ; super end
19
- def compile_assets() @call_order << 'compile_assets' ; super end
20
- def symlink() @call_order << 'symlink' ; super end
21
- def restart() @call_order << 'restart' ; super end
22
- def cleanup_old_releases() @call_order << 'cleanup_old_releases' ; super end
23
- def enable_maintenance_page() @call_order << 'enable_maintenance_page' ; super end
24
- def disable_maintenance_page() @call_order << 'disable_maintenance_page'; super end
25
- def gc_repository_cache() @call_order << 'gc_repository_cache' ; super end
26
- end
27
-
28
- config = EY::Serverside::Deploy::Configuration.new(default_configuration)
29
-
30
- td = TestDeploy.realnew(test_servers, config, test_shell)
31
- mock_bundler
32
- with_mocked_commands do
33
- capture do
34
- td.deploy
35
- end
36
- end
37
-
38
- ############################# IMPORTANT ####################################
39
- #
40
- # Call order is referenced in the engineyard gem eydeploy.rb documentation.
41
- #
42
- # https://support.cloud.engineyard.com/entries/20996661-customize-your-deployment
43
- #
44
- # Changing call order or removing methods may adversely affect customers
45
- # that are using eydeploy.rb and relying on this documentation.
46
- #
47
- ############################################################################
48
- expect(td.call_order).to eq(%w(
49
- push_code
50
- copy_repository_cache
51
- create_revision_file
52
- bundle
53
- setup_services
54
- symlink_configs
55
- compile_assets
56
- enable_maintenance_page
57
- migrate
58
- symlink
59
- restart
60
- disable_maintenance_page
61
- cleanup_old_releases
62
- gc_repository_cache))
63
- end
64
-
65
- describe "task overrides" do
66
- before(:each) do
67
- @tempdir = Pathname.new(`mktemp -d -t custom_deploy_spec.XXXXX`.strip)
68
- end
69
-
70
- def write_eydeploy(relative_path, contents = "def got_new_methods() 'from the file on disk' end")
71
- path = @tempdir.join(relative_path)
72
- path.dirname.mkpath
73
- path.open('w') { |f| f << contents }
74
- end
75
-
76
- describe "eydeploy_rb disabled" do
77
- before do
78
- @config = EY::Serverside::Deploy::Configuration.new('app' => 'app_name', 'repository_cache' => @tempdir.to_s, 'eydeploy_rb' => 'false')
79
- @deploy = FullTestDeploy.realnew(test_servers, @config, test_shell)
80
- end
81
-
82
- it "doesn't load eydeploy_rb file" do
83
- write_eydeploy 'eydeploy.rb'
84
- @deploy.require_custom_tasks
85
- expect(@deploy).not_to respond_to(:got_new_methods)
86
- end
87
- end
88
-
89
- describe "eydeploy_rb detect or enabled" do
90
- before do
91
- @config = EY::Serverside::Deploy::Configuration.new('app' => 'app_name', 'repository_cache' => @tempdir.to_s, 'eydeploy_rb' => 'true')
92
- @deploy = FullTestDeploy.realnew(test_servers, @config, test_shell)
93
- end
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
- expect(@deploy.got_new_methods).to eq('from the file on disk')
99
- end
100
-
101
- it "falls back to 'config/eydeploy.rb'" do
102
- write_eydeploy 'config/eydeploy.rb'
103
- @deploy.require_custom_tasks
104
- expect(@deploy.got_new_methods).to eq('from the file on disk')
105
- end
106
-
107
- it "lets you super up from any defined methods" do
108
- write_eydeploy 'eydeploy.rb', "def value() super << ' + derived' end"
109
-
110
- class TestDeploySuper < FullTestDeploy
111
- def value() 'base' end
112
- end
113
-
114
- deploy = TestDeploySuper.realnew(test_servers, @config, test_shell)
115
- deploy.require_custom_tasks
116
- expect(deploy.value).to eq("base + derived")
117
- end
118
-
119
- it "records exceptions raised from the instance eval in the log" do
120
- write_eydeploy 'eydeploy.rb', "raise 'Imma blow up'"
121
- expect { @deploy.require_custom_tasks }.to raise_error
122
- log = @log_path.read
123
- expect(log).to match(/Exception while loading .*eydeploy\.rb/)
124
- expect(log).to include('Imma blow up')
125
- end
126
- end
127
- end
128
- end