mina 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +11 -3
  3. data/.gitignore +0 -1
  4. data/.rspec +1 -1
  5. data/.rubocop.yml +28 -1126
  6. data/CHANGELOG.md +89 -8
  7. data/Gemfile +2 -0
  8. data/Gemfile.lock +73 -0
  9. data/Rakefile +2 -0
  10. data/Readme.md +8 -12
  11. data/bin/mina +2 -0
  12. data/data/deploy.rb +6 -4
  13. data/docs/3rd_party_plugins.md +1 -0
  14. data/docs/assets/images/mina.png +0 -0
  15. data/docs/default_plugins.md +1 -1
  16. data/docs/how_mina_works.md +2 -2
  17. data/lib/Minafile +1 -0
  18. data/lib/mina/application.rb +45 -35
  19. data/lib/mina/backend/local.rb +2 -0
  20. data/lib/mina/backend/remote.rb +3 -1
  21. data/lib/mina/commands.rb +10 -7
  22. data/lib/mina/configuration.rb +6 -3
  23. data/lib/mina/dsl.rb +2 -2
  24. data/lib/mina/helpers/internal.rb +8 -8
  25. data/lib/mina/helpers/output.rb +5 -3
  26. data/lib/mina/runner/exec.rb +2 -0
  27. data/lib/mina/runner/pretty.rb +25 -19
  28. data/lib/mina/runner/printer.rb +2 -0
  29. data/lib/mina/runner/system.rb +2 -0
  30. data/lib/mina/runner.rb +9 -10
  31. data/lib/mina/version.rb +3 -1
  32. data/lib/mina/windows_patches.rb +4 -2
  33. data/lib/mina.rb +4 -3
  34. data/mina.gemspec +8 -7
  35. data/spec/configs/default.rb +8 -0
  36. data/spec/configs/dsl.rb +55 -0
  37. data/spec/configs/e2e.rb +25 -0
  38. data/spec/e2e/docker-compose.yml +21 -0
  39. data/spec/e2e/e2e_run.sh +11 -0
  40. data/spec/e2e/e2e_spec.rb +35 -0
  41. data/spec/e2e/ssh +27 -0
  42. data/spec/e2e/ssh.pub +1 -0
  43. data/spec/lib/mina/application_spec.rb +94 -35
  44. data/spec/lib/mina/backend/local_spec.rb +5 -2
  45. data/spec/lib/mina/backend/remote_spec.rb +5 -3
  46. data/spec/lib/mina/commands_spec.rb +7 -7
  47. data/spec/lib/mina/configuration_spec.rb +63 -3
  48. data/spec/lib/mina/dsl_spec.rb +94 -0
  49. data/spec/lib/mina/helpers/internal_spec.rb +88 -10
  50. data/spec/lib/mina/helpers/output_spec.rb +13 -10
  51. data/spec/lib/mina/runner/exec_spec.rb +19 -0
  52. data/spec/lib/mina/runner/pretty_spec.rb +17 -0
  53. data/spec/lib/mina/runner/printer_spec.rb +19 -0
  54. data/spec/lib/mina/runner/system_spec.rb +19 -0
  55. data/spec/lib/mina/runner_spec.rb +6 -10
  56. data/spec/spec_helper.rb +33 -14
  57. data/spec/support/outputs/bundle_clean.txt +2 -2
  58. data/spec/support/outputs/chruby_with_env.txt +7 -0
  59. data/spec/support/outputs/chruby_without_env.txt +2 -0
  60. data/spec/support/outputs/debug_configuration_variables.txt +11 -0
  61. data/spec/support/outputs/dsl_deploy.txt +4 -0
  62. data/spec/support/outputs/dsl_in_path.txt +1 -0
  63. data/spec/support/outputs/dsl_local_run.txt +5 -0
  64. data/spec/support/outputs/dsl_on.txt +6 -0
  65. data/spec/support/outputs/dsl_remote_run.txt +5 -0
  66. data/spec/support/outputs/dsl_reset.txt +2 -0
  67. data/spec/support/outputs/e2e_deploy_after_setup.txt +1 -0
  68. data/spec/support/outputs/e2e_deploy_without_setup.txt +1 -0
  69. data/spec/support/outputs/e2e_setup.txt +1 -0
  70. data/spec/support/outputs/environment.txt +1 -0
  71. data/spec/support/outputs/git_ensure_pushed.txt +15 -0
  72. data/spec/support/outputs/rails_assets_precompile_force_precompile.txt +2 -0
  73. data/spec/support/outputs/rails_assets_precompile_outside_deploy_block.txt +1 -0
  74. data/spec/support/outputs/rails_assets_precompile_with_diff.txt +7 -0
  75. data/spec/support/outputs/rails_console.txt +1 -0
  76. data/spec/support/outputs/rails_db_migrate_force_migrate.txt +2 -0
  77. data/spec/support/outputs/rails_db_migrate_outside_deploy_block.txt +1 -0
  78. data/spec/support/outputs/rails_db_migrate_with_diff.txt +7 -0
  79. data/spec/support/outputs/rails_log.txt +1 -0
  80. data/spec/support/outputs/rails_with_arguments.txt +1 -0
  81. data/spec/support/outputs/rails_without_arguments.txt +1 -0
  82. data/spec/support/outputs/rake_with_arguments.txt +1 -0
  83. data/spec/support/outputs/rake_without_arguments.txt +1 -0
  84. data/spec/support/outputs/rbenv_load.txt +9 -1
  85. data/spec/support/outputs/rvm_use_with_env.txt +8 -0
  86. data/spec/support/outputs/rvm_use_without_env.txt +2 -0
  87. data/spec/support/outputs/rvm_wrapper_with_arguments.txt +8 -0
  88. data/spec/support/outputs/rvm_wrapper_without_arguments.txt +2 -0
  89. data/spec/support/outputs/ry_with_env.txt +13 -0
  90. data/spec/support/outputs/ry_without_env.txt +13 -0
  91. data/spec/support/outputs/ssh.txt +1 -0
  92. data/spec/support/outputs/ssh_keyscan_domain.txt +3 -0
  93. data/spec/support/rake_example_group.rb +23 -19
  94. data/spec/tasks/bundler_spec.rb +6 -0
  95. data/spec/tasks/chruby_spec.rb +29 -0
  96. data/spec/tasks/default_spec.rb +79 -7
  97. data/spec/tasks/deploy_spec.rb +6 -0
  98. data/spec/tasks/git_spec.rb +12 -0
  99. data/spec/tasks/init_spec.rb +13 -4
  100. data/spec/tasks/rails_spec.rb +126 -15
  101. data/spec/tasks/rbenv_spec.rb +15 -0
  102. data/spec/tasks/rvm_spec.rb +51 -0
  103. data/spec/tasks/ry_spec.rb +43 -0
  104. data/tasks/mina/bundler.rb +7 -5
  105. data/tasks/mina/chruby.rb +7 -5
  106. data/tasks/mina/default.rb +19 -12
  107. data/tasks/mina/deploy.rb +26 -24
  108. data/tasks/mina/git.rb +28 -16
  109. data/tasks/mina/install.rb +3 -1
  110. data/tasks/mina/rails.rb +29 -27
  111. data/tasks/mina/rbenv.rb +8 -6
  112. data/tasks/mina/rvm.rb +13 -11
  113. data/tasks/mina/ry.rb +11 -11
  114. data/test_env/config/deploy.rb +9 -8
  115. metadata +64 -32
  116. data/spec/support/outputs/chruby.txt +0 -9
  117. data/spec/support/outputs/console.txt +0 -1
  118. data/spec/support/outputs/log.txt +0 -1
  119. data/spec/support/outputs/rails_db_migrate.txt +0 -1
  120. data/spec/support/outputs/rvm_use.txt +0 -1
  121. data/spec/support/outputs/ry.txt +0 -15
  122. data/spec/tasks/ruby_managers_spec.rb +0 -33
data/CHANGELOG.md CHANGED
@@ -1,6 +1,72 @@
1
- # Change Log
1
+ # Changelog
2
+
3
+ ## [v1.2.4](https://github.com/mina-deploy/mina/tree/v1.2.4) (2021-08-10)
4
+
5
+ [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.2.3...v1.2.4)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Make `in_path` tolerate "directory doesn't exist" case [\#587](https://github.com/mina-deploy/mina/issues/587)
10
+ - Different behavior of environment task with 0.3.8 and 1.0.6 [\#505](https://github.com/mina-deploy/mina/issues/505)
11
+
12
+ **Closed issues:**
13
+
14
+ - Mina deploy failed with Rails and Vue? [\#659](https://github.com/mina-deploy/mina/issues/659)
15
+ - Running "mina deploy" failed when "Precompiling asset files", without any detailed error info [\#658](https://github.com/mina-deploy/mina/issues/658)
16
+ - Stuck on "Fetching new git commits" [\#654](https://github.com/mina-deploy/mina/issues/654)
17
+ - remote: Repository not found. fatal: Authentication failed for 'https://:@github.com/usre\_name/repo.git/' [\#649](https://github.com/mina-deploy/mina/issues/649)
18
+ - Error ""The directory 'X' does not exist on the server", run 'mina setup' first! [\#648](https://github.com/mina-deploy/mina/issues/648)
19
+ - git clone "/app/scm" [\#647](https://github.com/mina-deploy/mina/issues/647)
20
+ - fatal: destination path '.' already exists and is not an empty directory. [\#646](https://github.com/mina-deploy/mina/issues/646)
21
+ - Unable to run any rails command in the project server folder [\#645](https://github.com/mina-deploy/mina/issues/645)
22
+ - Is this project alive? [\#642](https://github.com/mina-deploy/mina/issues/642)
23
+ - Why need run\(local\) do block? [\#638](https://github.com/mina-deploy/mina/issues/638)
24
+ - mina init overrides config/deploy.rb [\#634](https://github.com/mina-deploy/mina/issues/634)
25
+ - What's the role of "on :launch do" part of deploy.rb [\#631](https://github.com/mina-deploy/mina/issues/631)
26
+ - Are there release notes for 1.0 [\#630](https://github.com/mina-deploy/mina/issues/630)
27
+ - ArgumentError: invalid byte sequence in US-ASCII when deploying using GitLab CI with Docker [\#629](https://github.com/mina-deploy/mina/issues/629)
28
+ - Git SHA information on deploy or rollback [\#626](https://github.com/mina-deploy/mina/issues/626)
29
+ - \(Doc\) 0 downtime deploy example in Mina document? [\#619](https://github.com/mina-deploy/mina/issues/619)
30
+ - ENV is not loading in production [\#617](https://github.com/mina-deploy/mina/issues/617)
31
+ - how to add `config/database.yml` to shared\_path without an error [\#614](https://github.com/mina-deploy/mina/issues/614)
32
+ - Deploy without using current/shared/releases? [\#613](https://github.com/mina-deploy/mina/issues/613)
33
+ - mina deploy fails [\#612](https://github.com/mina-deploy/mina/issues/612)
34
+ - Feature: Force precompile for webpacker [\#610](https://github.com/mina-deploy/mina/issues/610)
35
+ - SSH Connection [\#608](https://github.com/mina-deploy/mina/issues/608)
36
+ - Connection to closed after mina setup [\#607](https://github.com/mina-deploy/mina/issues/607)
37
+ - NameError: undefined local variable or method `user' for main:Object [\#606](https://github.com/mina-deploy/mina/issues/606)
38
+ - node\_modules in shared\_paths [\#604](https://github.com/mina-deploy/mina/issues/604)
39
+ - mina deploy rails 5.2.0.beta2 [\#602](https://github.com/mina-deploy/mina/issues/602)
40
+ - sudo systemctl restart apache2 [\#598](https://github.com/mina-deploy/mina/issues/598)
41
+ - I got a 'extconf.rb failed' error when mina bundle install [\#597](https://github.com/mina-deploy/mina/issues/597)
42
+ - Is it possible to view or output the generated bash script? [\#596](https://github.com/mina-deploy/mina/issues/596)
43
+ - mina deploy throws error - bundle: command not found ! ERROR: Deploy failed. [\#594](https://github.com/mina-deploy/mina/issues/594)
44
+ - Could you add back set\_default? [\#588](https://github.com/mina-deploy/mina/issues/588)
45
+ - Mina setup doesn't symlink the current folder [\#571](https://github.com/mina-deploy/mina/issues/571)
46
+ - mina deploy Could not locate Gemfile [\#552](https://github.com/mina-deploy/mina/issues/552)
47
+ - SSH to GitLab repository problem [\#533](https://github.com/mina-deploy/mina/issues/533)
48
+ - Does a full bundle install every time [\#516](https://github.com/mina-deploy/mina/issues/516)
49
+ - assets:precompile failed, but deploy succeeded [\#504](https://github.com/mina-deploy/mina/issues/504)
50
+ - Could not find rack-cors-0.4.0 in any of the sources [\#500](https://github.com/mina-deploy/mina/issues/500)
51
+
52
+ **Merged pull requests:**
53
+
54
+ - Test suite CI [\#673](https://github.com/mina-deploy/mina/pull/673) ([lovro-bikic](https://github.com/lovro-bikic))
55
+ - Fixes \#634 [\#650](https://github.com/mina-deploy/mina/pull/650) ([NBuhinicek](https://github.com/NBuhinicek))
56
+ - Fix minor typo in documentation [\#641](https://github.com/mina-deploy/mina/pull/641) ([chartrandf](https://github.com/chartrandf))
57
+ - Update cookbook.md [\#637](https://github.com/mina-deploy/mina/pull/637) ([oliveiradanielm](https://github.com/oliveiradanielm))
58
+ - Update default\_plugins.md [\#635](https://github.com/mina-deploy/mina/pull/635) ([mpearce](https://github.com/mpearce))
59
+ - Update deploy.rb [\#628](https://github.com/mina-deploy/mina/pull/628) ([Ajmal](https://github.com/Ajmal))
60
+ - Added link to mina multideploy plugin [\#627](https://github.com/mina-deploy/mina/pull/627) ([volkov-sergey](https://github.com/volkov-sergey))
61
+ - Add Thinking Sphinx plugin link [\#624](https://github.com/mina-deploy/mina/pull/624) ([airled](https://github.com/airled))
62
+ - Typo 'everyting' [\#599](https://github.com/mina-deploy/mina/pull/599) ([wafiq](https://github.com/wafiq))
63
+ - allow user to overwrite deploy\_script [\#595](https://github.com/mina-deploy/mina/pull/595) ([kuboon](https://github.com/kuboon))
64
+ - Fixes \#506. Problem with git submodules and no master based branches. [\#593](https://github.com/mina-deploy/mina/pull/593) ([platbr](https://github.com/platbr))
65
+ - Fix doc typos. [\#591](https://github.com/mina-deploy/mina/pull/591) ([pweldon](https://github.com/pweldon))
66
+ - Allow setting a custom deploy script [\#585](https://github.com/mina-deploy/mina/pull/585) ([wpolicarpo](https://github.com/wpolicarpo))
2
67
 
3
68
  ## [v1.2.3](https://github.com/mina-deploy/mina/tree/v1.2.3) (2017-11-22)
69
+
4
70
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.2.2...v1.2.3)
5
71
 
6
72
  **Closed issues:**
@@ -9,20 +75,17 @@
9
75
 
10
76
  **Merged pull requests:**
11
77
 
12
- - Fix empty stage queue [\#592](https://github.com/mina-deploy/mina/pull/592) ([Narayanan170](https://github.com/Narayanan170))
78
+ - Fix empty stage queue [\#592](https://github.com/mina-deploy/mina/pull/592) ([fsuste](https://github.com/fsuste))
13
79
  - fix typo [\#584](https://github.com/mina-deploy/mina/pull/584) ([MatzFan](https://github.com/MatzFan))
14
80
 
15
81
  ## [v1.2.2](https://github.com/mina-deploy/mina/tree/v1.2.2) (2017-10-13)
82
+
16
83
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.2.1...v1.2.2)
17
84
 
18
85
  **Implemented enhancements:**
19
86
 
20
87
  - Add shared folders validations [\#559](https://github.com/mina-deploy/mina/issues/559)
21
88
 
22
- **Fixed bugs:**
23
-
24
- - Add shared folders validations [\#559](https://github.com/mina-deploy/mina/issues/559)
25
-
26
89
  **Closed issues:**
27
90
 
28
91
  - prepend environments when run outside run block [\#576](https://github.com/mina-deploy/mina/issues/576)
@@ -36,6 +99,7 @@
36
99
  - Remote environment in deploy example [\#573](https://github.com/mina-deploy/mina/pull/573) ([ozgg](https://github.com/ozgg))
37
100
 
38
101
  ## [v1.2.1](https://github.com/mina-deploy/mina/tree/v1.2.1) (2017-10-02)
102
+
39
103
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.2.0...v1.2.1)
40
104
 
41
105
  **Closed issues:**
@@ -43,6 +107,7 @@
43
107
  - Deploy does not work since version 1.2.0 [\#572](https://github.com/mina-deploy/mina/issues/572)
44
108
 
45
109
  ## [v1.2.0](https://github.com/mina-deploy/mina/tree/v1.2.0) (2017-09-29)
110
+
46
111
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.1.1...v1.2.0)
47
112
 
48
113
  **Fixed bugs:**
@@ -50,9 +115,11 @@
50
115
  - Fix keyscan\_domain task [\#570](https://github.com/mina-deploy/mina/issues/570)
51
116
 
52
117
  ## [v1.1.1](https://github.com/mina-deploy/mina/tree/v1.1.1) (2017-09-29)
118
+
53
119
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.1.0...v1.1.1)
54
120
 
55
121
  ## [v1.1.0](https://github.com/mina-deploy/mina/tree/v1.1.0) (2017-09-29)
122
+
56
123
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.7...v1.1.0)
57
124
 
58
125
  **Implemented enhancements:**
@@ -91,6 +158,7 @@
91
158
  - Add skip-existing option to example rbenv install [\#527](https://github.com/mina-deploy/mina/pull/527) ([sunny](https://github.com/sunny))
92
159
 
93
160
  ## [v1.0.7](https://github.com/mina-deploy/mina/tree/v1.0.7) (2017-09-08)
161
+
94
162
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.6...v1.0.7)
95
163
 
96
164
  **Closed issues:**
@@ -128,12 +196,15 @@
128
196
  - Add mina-hanami [\#495](https://github.com/mina-deploy/mina/pull/495) ([mgrachev](https://github.com/mgrachev))
129
197
 
130
198
  ## [v1.0.6](https://github.com/mina-deploy/mina/tree/v1.0.6) (2016-12-15)
199
+
131
200
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.5...v1.0.6)
132
201
 
133
202
  ## [v1.0.5](https://github.com/mina-deploy/mina/tree/v1.0.5) (2016-12-15)
203
+
134
204
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.4...v1.0.5)
135
205
 
136
206
  ## [v1.0.4](https://github.com/mina-deploy/mina/tree/v1.0.4) (2016-12-15)
207
+
137
208
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.3...v1.0.4)
138
209
 
139
210
  **Implemented enhancements:**
@@ -166,6 +237,7 @@
166
237
  - Restore previous path after in\_path block [\#478](https://github.com/mina-deploy/mina/pull/478) ([sobrinho](https://github.com/sobrinho))
167
238
 
168
239
  ## [v1.0.3](https://github.com/mina-deploy/mina/tree/v1.0.3) (2016-11-08)
240
+
169
241
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.2...v1.0.3)
170
242
 
171
243
  **Closed issues:**
@@ -191,6 +263,7 @@
191
263
  - Allow to overwrite existing :shared\_files with the symlink to shared \(fixes \#452\) [\#455](https://github.com/mina-deploy/mina/pull/455) ([ralfebert](https://github.com/ralfebert))
192
264
 
193
265
  ## [v1.0.2](https://github.com/mina-deploy/mina/tree/v1.0.2) (2016-10-12)
266
+
194
267
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.0...v1.0.2)
195
268
 
196
269
  **Fixed bugs:**
@@ -216,6 +289,7 @@
216
289
  - Fix rvm:use task [\#444](https://github.com/mina-deploy/mina/pull/444) ([devvmh](https://github.com/devvmh))
217
290
 
218
291
  ## [v1.0.0](https://github.com/mina-deploy/mina/tree/v1.0.0) (2016-09-27)
292
+
219
293
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.0.rc2...v1.0.0)
220
294
 
221
295
  **Closed issues:**
@@ -224,9 +298,11 @@
224
298
  - Support for nvm [\#440](https://github.com/mina-deploy/mina/issues/440)
225
299
 
226
300
  ## [v1.0.0.rc2](https://github.com/mina-deploy/mina/tree/v1.0.0.rc2) (2016-09-19)
301
+
227
302
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.0.rc1...v1.0.0.rc2)
228
303
 
229
304
  ## [v1.0.0.rc1](https://github.com/mina-deploy/mina/tree/v1.0.0.rc1) (2016-09-19)
305
+
230
306
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.0.beta5...v1.0.0.rc1)
231
307
 
232
308
  **Implemented enhancements:**
@@ -254,6 +330,7 @@
254
330
  - strip whitespace from commands by default [\#427](https://github.com/mina-deploy/mina/pull/427) ([devvmh](https://github.com/devvmh))
255
331
 
256
332
  ## [v1.0.0.beta5](https://github.com/mina-deploy/mina/tree/v1.0.0.beta5) (2016-08-30)
333
+
257
334
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.0.beta4...v1.0.0.beta5)
258
335
 
259
336
  **Closed issues:**
@@ -261,9 +338,11 @@
261
338
  - How to do a proper finish hook? [\#425](https://github.com/mina-deploy/mina/issues/425)
262
339
 
263
340
  ## [v1.0.0.beta4](https://github.com/mina-deploy/mina/tree/v1.0.0.beta4) (2016-08-28)
341
+
264
342
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.0.beta3...v1.0.0.beta4)
265
343
 
266
344
  ## [v1.0.0.beta3](https://github.com/mina-deploy/mina/tree/v1.0.0.beta3) (2016-08-28)
345
+
267
346
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.0.beta2...v1.0.0.beta3)
268
347
 
269
348
  **Implemented enhancements:**
@@ -285,12 +364,13 @@
285
364
  **Merged pull requests:**
286
365
 
287
366
  - change docs about invoking rvm:use with arguments [\#413](https://github.com/mina-deploy/mina/pull/413) ([devvmh](https://github.com/devvmh))
288
- - add Rbenv and RVM notes [\#412](https://github.com/mina-deploy/mina/pull/412) ([pinewong](https://github.com/pinewong))
367
+ - add Rbenv and RVM notes [\#412](https://github.com/mina-deploy/mina/pull/412) ([songhuangcn](https://github.com/songhuangcn))
289
368
  - fix issues with rbenv:load [\#411](https://github.com/mina-deploy/mina/pull/411) ([devvmh](https://github.com/devvmh))
290
369
  - ensure git pushed function - code props to @fgarcia [\#410](https://github.com/mina-deploy/mina/pull/410) ([devvmh](https://github.com/devvmh))
291
370
  - fix infinite loop in suggested default config [\#409](https://github.com/mina-deploy/mina/pull/409) ([devvmh](https://github.com/devvmh))
292
371
 
293
372
  ## [v1.0.0.beta2](https://github.com/mina-deploy/mina/tree/v1.0.0.beta2) (2016-07-30)
373
+
294
374
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v1.0.0.beta1...v1.0.0.beta2)
295
375
 
296
376
  **Implemented enhancements:**
@@ -364,6 +444,7 @@
364
444
  - Feature/configuration dsl [\#398](https://github.com/mina-deploy/mina/pull/398) ([vr4b4c](https://github.com/vr4b4c))
365
445
 
366
446
  ## [v1.0.0.beta1](https://github.com/mina-deploy/mina/tree/v1.0.0.beta1) (2016-06-30)
447
+
367
448
  [Full Changelog](https://github.com/mina-deploy/mina/compare/v0.3.8...v1.0.0.beta1)
368
449
 
369
450
  **Closed issues:**
@@ -385,4 +466,4 @@
385
466
 
386
467
 
387
468
 
388
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
469
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in mina.gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,73 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mina (1.2.5)
5
+ rake
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ coderay (1.1.3)
12
+ diff-lcs (1.4.4)
13
+ docile (1.4.0)
14
+ method_source (1.0.0)
15
+ parallel (1.20.1)
16
+ parser (3.0.2.0)
17
+ ast (~> 2.4.1)
18
+ pry (0.14.1)
19
+ coderay (~> 1.1)
20
+ method_source (~> 1.0)
21
+ rainbow (3.0.0)
22
+ rake (13.0.6)
23
+ regexp_parser (2.1.1)
24
+ rexml (3.2.5)
25
+ rspec (3.10.0)
26
+ rspec-core (~> 3.10.0)
27
+ rspec-expectations (~> 3.10.0)
28
+ rspec-mocks (~> 3.10.0)
29
+ rspec-core (3.10.1)
30
+ rspec-support (~> 3.10.0)
31
+ rspec-expectations (3.10.1)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.10.0)
34
+ rspec-mocks (3.10.2)
35
+ diff-lcs (>= 1.2.0, < 2.0)
36
+ rspec-support (~> 3.10.0)
37
+ rspec-support (3.10.2)
38
+ rubocop (1.19.1)
39
+ parallel (~> 1.10)
40
+ parser (>= 3.0.0.0)
41
+ rainbow (>= 2.2.2, < 4.0)
42
+ regexp_parser (>= 1.8, < 3.0)
43
+ rexml
44
+ rubocop-ast (>= 1.9.1, < 2.0)
45
+ ruby-progressbar (~> 1.7)
46
+ unicode-display_width (>= 1.4.0, < 3.0)
47
+ rubocop-ast (1.10.0)
48
+ parser (>= 3.0.1.1)
49
+ rubocop-rspec (2.4.0)
50
+ rubocop (~> 1.0)
51
+ rubocop-ast (>= 1.1.0)
52
+ ruby-progressbar (1.11.0)
53
+ simplecov (0.21.2)
54
+ docile (~> 1.1)
55
+ simplecov-html (~> 0.11)
56
+ simplecov_json_formatter (~> 0.1)
57
+ simplecov-html (0.12.3)
58
+ simplecov_json_formatter (0.1.3)
59
+ unicode-display_width (2.0.0)
60
+
61
+ PLATFORMS
62
+ ruby
63
+
64
+ DEPENDENCIES
65
+ mina!
66
+ pry
67
+ rspec
68
+ rubocop
69
+ rubocop-rspec
70
+ simplecov
71
+
72
+ BUNDLED WITH
73
+ 2.3.13
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
data/Readme.md CHANGED
@@ -1,11 +1,8 @@
1
1
  # Mina
2
2
 
3
- [![Code Climate](https://codeclimate.com/github/mina-deploy/mina/badges/gpa.svg)](https://codeclimate.com/github/mina-deploy/mina)
4
- [![Test Coverage](https://codeclimate.com/github/mina-deploy/mina/badges/coverage.svg)](https://codeclimate.com/github/mina-deploy/mina/coverage)
5
- [![Build Status](https://semaphoreci.com/api/v1/d4be4st/mina/branches/master/shields_badge.svg)](https://semaphoreci.com/d4be4st/mina)
6
3
  [![Gem Version](https://badge.fury.io/rb/mina.svg)](https://badge.fury.io/rb/mina)
7
4
 
8
- ![mina](https://photos.infinum.co/store/5273935c5deeabda0e98c943db2a7ade)
5
+ ![mina](/docs/assets/images/mina.png?raw=true)
9
6
 
10
7
  Really fast deployer and server automation tool.
11
8
 
@@ -18,18 +15,17 @@ Mina works really fast because it's a deploy Bash script generator. It
18
15
  generates an entire procedure as a Bash script and runs it remotely in the
19
16
  server.
20
17
 
21
- Compare this to the likes of [Capistrano](https://github.com/capistrano/capistrano), where it opens an SSH connection and runs each command in sequence
22
- , Mina only creates a SSH session and sends *one* command.
18
+ Compare this to the likes of [Capistrano](https://github.com/capistrano/capistrano), where it opens an SSH connection and runs each command in sequence, Mina only creates a SSH session and sends *one* command.
23
19
 
24
20
  $ gem install mina
25
21
  $ mina init
26
22
 
27
- Mina requires ruby 2.0.0 or greater. For older please use [0.3.8 version](https://github.com/mina-deploy/mina/blob/v0.3.8/)
23
+ Mina requires ruby 2.0.0 or greater. For older versions of Ruby, please use [0.3.8 version](https://github.com/mina-deploy/mina/blob/v0.3.8/).
28
24
 
29
25
  Documentation
30
26
  ----------------
31
27
 
32
- For quick start check out [Getting starting guide](docs/getting_started.md)
28
+ For quick start check out [Getting started guide](docs/getting_started.md)
33
29
 
34
30
  For migrating your current 0.3.x deploy scripts, please look at the [migrating guide](docs/migrating.md)
35
31
 
@@ -39,7 +35,7 @@ If you are missing some plugins check the [3rd party plugins doc](docs/3rd_party
39
35
 
40
36
  For other documentation please visit the [docs](docs)
41
37
 
42
- Licence
38
+ License
43
39
  ----------------
44
40
 
45
41
  Released under the [MIT License](https://www.opensource.org/licenses/mit-license.php).
@@ -47,8 +43,8 @@ Released under the [MIT License](https://www.opensource.org/licenses/mit-license
47
43
  Credits
48
44
  ----------------
49
45
 
50
- Mina is maintained and sponsored by [Infinum](https://infinum.co).
46
+ Mina is maintained and sponsored by [Infinum](https://infinum.com).
51
47
 
52
- You can reach us on twitter [Stef](https://twitter.com/_Beast_) & [Infinum](https://twitter.com/infinumco)
48
+ You can reach us on twitter [Stef](https://twitter.com/_Beast_) & [Infinum](https://twitter.com/infinum).
53
49
 
54
- ![](https://assets.infinum.co/assets/brand-logo-9e079bfa1875e17c8c1f71d1fee49cf0.svg) © 2016 Infinum.
50
+ © 2021 Infinum
data/bin/mina CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  require 'mina'
3
5
 
4
6
  Mina::Application.new.run
data/data/deploy.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mina/rails'
2
4
  require 'mina/git'
3
5
  # require 'mina/rbenv' # for rbenv support. (https://rbenv.org)
@@ -45,7 +47,7 @@ task :setup do
45
47
  # command %{gem install bundler}
46
48
  end
47
49
 
48
- desc "Deploys the current version to the server."
50
+ desc 'Deploys the current version to the server.'
49
51
  task :deploy do
50
52
  # uncomment this line to make sure you pushed your local branch to the remote origin
51
53
  # invoke :'git:ensure_pushed'
@@ -61,13 +63,13 @@ task :deploy do
61
63
 
62
64
  on :launch do
63
65
  in_path(fetch(:current_path)) do
64
- command %{mkdir -p tmp/}
65
- command %{touch tmp/restart.txt}
66
+ command %(mkdir -p tmp/)
67
+ command %(touch tmp/restart.txt)
66
68
  end
67
69
  end
68
70
  end
69
71
 
70
- # you can use `run :local` to run tasks on local machine before of after the deploy scripts
72
+ # you can use `run :local` to run tasks on local machine before or after the deploy scripts
71
73
  # run(:local){ say 'done' }
72
74
  end
73
75
 
@@ -32,6 +32,7 @@
32
32
  * [mina-systemd](https://github.com/alexkojin/mina-systemd)
33
33
  * [mina-tail](https://github.com/modomoto/mina-tail)
34
34
  * [mina-unicorn](https://github.com/openteam/mina-unicorn)
35
+ * [mina-unicorn_systemd](https://github.com/coezbek/mina-unicorn_systemd)
35
36
  * [mina-whenever](https://github.com/mina-deploy/mina-whenever)
36
37
  * [mina-lock](https://github.com/lorenzosinisi/mina-lock)
37
38
  * [mina-thinking-sphinx](https://github.com/airled/mina-thinking-sphinx)
Binary file
@@ -1,6 +1,6 @@
1
1
  # Default Plugins
2
2
 
3
- `mina` comes with a variaty of plugins for you to use out of the box. As `mina` is primarely written in ruby and for rails, it has
3
+ `mina` comes with a variety of plugins for you to use out of the box. As `mina` is primarely written in ruby and for rails, it has
4
4
  ruby plugins, but it can be used to deploy any other application (static, js, php, etc)
5
5
 
6
6
  To use a plugin you only need to require it in your `deploy.rb`. Most of the plugins come with a set of their
@@ -152,11 +152,11 @@ Mode | Description
152
152
  -----|------------
153
153
  `:exec` | It uses [Kernel#exec](http://ruby-doc.org/core-2.4.2/Kernel.html#method-i-exec) to run your script. This means that it will execute and exit and won't run any other tasks. This is useful for tasks such as [`mina console`](https://github.com/mina-deploy/mina/blob/master/tasks/mina/rails.rb#L15)
154
154
  `:system` | It uses [Kernel#system](http://ruby-doc.org/core-2.4.2/Kernel.html#method-i-system) to run your script.
155
- `:pretty` | It uses [Open4#popen4](https://github.com/ahoward/open4/blob/master/lib/open4.rb#L33) to run your script. This mode pretty prints stdout and stderr and colors it. This the default mode for most of the default tasks.
155
+ `:pretty` | It uses [Open3#popen3](https://ruby-doc.org/stdlib-3.0.0/libdoc/open3/rdoc/Open3.html#method-c-popen3) to run your script. This mode pretty prints stdout and stderr and colors it. This the default mode for most of the default tasks.
156
156
  `:printer` | It uses [Kernel#puts](http://ruby-doc.org/core-2.4.2/Kernel.html#method-i-puts) to run your script. This is used when `simulate` flag is set so it only prints out the generated script
157
157
 
158
158
  #### WARNING
159
- `:pretty` mode is using Popen4. In this mode STDIN is efectivly disabled. This means that any kind of inputs won't be forwarded to remote host. If you have a need for password input please use `:system` mode
159
+ `:pretty` mode is using popen3. In this mode STDIN is efectivly disabled. This means that any kind of inputs won't be forwarded to remote host. If you have a need for password input please use `:system` mode
160
160
 
161
161
  ### Backends
162
162
 
data/lib/Minafile CHANGED
@@ -1,3 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'mina/install'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Mina
2
4
  class Application < Rake::Application
3
5
  include Configuration::DSL
@@ -11,24 +13,27 @@ module Mina
11
13
  'mina'
12
14
  end
13
15
 
14
- def run
16
+ # :nocov:
17
+ def run(*args)
15
18
  Rake.application = self
16
- super
19
+ super(*args)
17
20
  end
21
+ # :nocov:
18
22
 
19
23
  def sort_options(options)
20
- not_applicable_to_mina = %w(quiet silent verbose dry-run)
21
- options.reject! do |(switch, *)|
22
- switch =~ /--#{Regexp.union(not_applicable_to_mina)}/
23
- end
24
+ options_not_applicable_to_mina = /--#{Regexp.union(['quiet', 'silent', 'verbose', 'dry-run'])}/
24
25
 
25
- super.push(version, verbose, simulate, debug_configuration_variables, no_report_time)
26
+ mina_options = options.reject { |(switch, *)| switch =~ options_not_applicable_to_mina }
27
+ mina_options += [version, verbose, simulate, debug_configuration_variables, no_report_time]
28
+
29
+ super(mina_options)
26
30
  end
27
31
 
28
32
  def top_level_tasks
29
33
  return @top_level_tasks if @top_level_tasks.include?('init')
30
- @top_level_tasks << :debug_configuration_variables
31
- @top_level_tasks << :run_commands
34
+
35
+ @top_level_tasks << 'debug_configuration_variables'
36
+ @top_level_tasks << 'run_commands'
32
37
  end
33
38
 
34
39
  private
@@ -38,48 +43,53 @@ module Mina
38
43
  end
39
44
 
40
45
  def version
41
- ['--version', '-V',
42
- 'Display the program version.',
43
- lambda do |_value|
44
- puts "Mina, version v#{Mina::VERSION}"
45
- exit
46
- end
46
+ [
47
+ '--version', '-V',
48
+ 'Display the program version.',
49
+ lambda do |_value|
50
+ puts "Mina, version v#{Mina::VERSION}"
51
+ exit
52
+ end
47
53
  ]
48
54
  end
49
55
 
50
56
  def verbose
51
- ['--verbose', '-v',
52
- 'Print more info',
53
- lambda do |_value|
54
- set(:verbose, true)
55
- end
57
+ [
58
+ '--verbose', '-v',
59
+ 'Print a command before its execution.',
60
+ lambda do |_value|
61
+ set(:verbose, true)
62
+ end
56
63
  ]
57
64
  end
58
65
 
59
66
  def simulate
60
- ['--simulate', '-s',
61
- 'Do a simulate run without executing actions',
62
- lambda do |_value|
63
- set(:simulate, true)
64
- end
67
+ [
68
+ '--simulate', '-s',
69
+ 'Run a simulation. All commands will be printed but not executed.',
70
+ lambda do |_value|
71
+ set(:simulate, true)
72
+ end
65
73
  ]
66
74
  end
67
75
 
68
76
  def debug_configuration_variables
69
- ['--debug-configuration-variables', '-d',
70
- 'Display the defined config variables before runnig the tasks.',
71
- lambda do |_value|
72
- set(:debug_configuration_variables, true)
73
- end
77
+ [
78
+ '--debug-configuration-variables', '-d',
79
+ 'Display configuration variables.',
80
+ lambda do |_value|
81
+ set(:debug_configuration_variables, true)
82
+ end
74
83
  ]
75
84
  end
76
85
 
77
86
  def no_report_time
78
- ['--no-report-time', nil,
79
- 'Skip time reporting',
80
- lambda do |_value|
81
- set(:skip_report_time, true)
82
- end
87
+ [
88
+ '--no-report-time', nil,
89
+ "Don't report execution time.",
90
+ lambda do |_value|
91
+ set(:skip_report_time, true)
92
+ end
83
93
  ]
84
94
  end
85
95
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Mina
2
4
  module Backend
3
5
  class Local
@@ -1,7 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Mina
2
4
  module Backend
3
5
  class Remote
4
6
  attr_reader :commands
7
+
5
8
  include Configuration::DSL
6
9
 
7
10
  def initialize(commands)
@@ -31,7 +34,6 @@ module Mina
31
34
  args += ' -tt'
32
35
  "ssh #{args}"
33
36
  end
34
-
35
37
  end
36
38
  end
37
39
  end
data/lib/mina/commands.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Mina
2
4
  class Commands
3
5
  extend Forwardable
@@ -19,11 +21,11 @@ module Mina
19
21
  end
20
22
 
21
23
  def comment(code, indent: nil)
22
- if indent
23
- queue[stage] << indent(indent, %{echo "-----> #{code}"})
24
- else
25
- queue[stage] << %{echo "-----> #{code}"}
26
- end
24
+ queue[stage] << if indent
25
+ indent(indent, %(echo "-----> #{code}"))
26
+ else
27
+ %(echo "-----> #{code}")
28
+ end
27
29
  end
28
30
 
29
31
  def delete(stage)
@@ -34,9 +36,9 @@ module Mina
34
36
  queue[stage] = []
35
37
  end
36
38
 
37
- def process(path = nil)
39
+ def process(path = nil) # rubocop:disable Metrics/AbcSize
38
40
  if path && !queue[stage].empty?
39
- queue[stage].unshift(%{echo "$ cd #{path}"}) if fetch(:verbose)
41
+ queue[stage].unshift(%(echo "$ cd #{path}")) if fetch(:verbose)
40
42
  %{(cd #{path} && #{queue[stage].join(' && ')} && cd -)}
41
43
  else
42
44
  queue[stage].join("\n")
@@ -49,6 +51,7 @@ module Mina
49
51
 
50
52
  def run(backend)
51
53
  return if queue.empty?
54
+
52
55
  report_time do
53
56
  status = Mina::Runner.new(process, backend).run
54
57
  error! 'Run Error' unless status