mina-traackr 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/.gitignore +10 -0
  2. data/.rspec +1 -0
  3. data/.travis.yml +12 -0
  4. data/CONTRIBUTING.md +124 -0
  5. data/Gemfile +10 -0
  6. data/HISTORY.md +304 -0
  7. data/LICENSE +23 -0
  8. data/Makefile +29 -0
  9. data/Notes.md +72 -0
  10. data/Rakefile +20 -0
  11. data/Readme.md +1009 -0
  12. data/bin/mina +65 -0
  13. data/data/deploy.rb +74 -0
  14. data/data/deploy.sh.erb +120 -0
  15. data/lib/mina.rb +23 -0
  16. data/lib/mina/bundler.rb +44 -0
  17. data/lib/mina/chruby.rb +49 -0
  18. data/lib/mina/default.rb +144 -0
  19. data/lib/mina/deploy.rb +138 -0
  20. data/lib/mina/deploy_helpers.rb +34 -0
  21. data/lib/mina/exec_helpers.rb +104 -0
  22. data/lib/mina/foreman.rb +78 -0
  23. data/lib/mina/git.rb +62 -0
  24. data/lib/mina/helpers.rb +383 -0
  25. data/lib/mina/output_helpers.rb +92 -0
  26. data/lib/mina/rails.rb +206 -0
  27. data/lib/mina/rake.rb +9 -0
  28. data/lib/mina/rbenv.rb +47 -0
  29. data/lib/mina/rvm.rb +88 -0
  30. data/lib/mina/settings.rb +32 -0
  31. data/lib/mina/ssh_helpers.rb +122 -0
  32. data/lib/mina/tools.rb +20 -0
  33. data/lib/mina/version.rb +5 -0
  34. data/lib/mina/whenever.rb +27 -0
  35. data/manual/index.md +15 -0
  36. data/manual/modules.md +2 -0
  37. data/mina.gemspec +17 -0
  38. data/spec/command_helper.rb +52 -0
  39. data/spec/commands/cleanup_spec.rb +16 -0
  40. data/spec/commands/command_spec.rb +71 -0
  41. data/spec/commands/custom_config_spec.rb +20 -0
  42. data/spec/commands/deploy_spec.rb +40 -0
  43. data/spec/commands/outside_project_spec.rb +35 -0
  44. data/spec/commands/real_deploy_spec.rb +54 -0
  45. data/spec/commands/ssh_spec.rb +14 -0
  46. data/spec/commands/verbose_spec.rb +21 -0
  47. data/spec/dsl/invoke_spec.rb +33 -0
  48. data/spec/dsl/queue_spec.rb +49 -0
  49. data/spec/dsl/settings_in_rake_spec.rb +39 -0
  50. data/spec/dsl/settings_spec.rb +55 -0
  51. data/spec/dsl/to_spec.rb +20 -0
  52. data/spec/fixtures/custom_file_env/custom_deploy.rb +15 -0
  53. data/spec/fixtures/empty_env/config/deploy.rb +15 -0
  54. data/spec/helpers/output_helper_spec.rb +38 -0
  55. data/spec/spec_helper.rb +21 -0
  56. data/support/Readme-footer.md +32 -0
  57. data/support/Readme-header.md +17 -0
  58. data/support/guide.md +297 -0
  59. data/support/index.html +53 -0
  60. data/support/to_md.rb +11 -0
  61. data/test_env/config/deploy.rb +72 -0
  62. metadata +157 -0
@@ -0,0 +1,10 @@
1
+ doc
2
+ test_env/deploy
3
+ .rvmrc
4
+ .ruby-gemset
5
+ .ruby-version
6
+ Gemfile.lock
7
+ pkg/
8
+ docs
9
+ support/helpers.md
10
+ support/modules.md
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ -c --order rand -t ~ssh
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.3
5
+ env:
6
+ - "rake=0.8"
7
+ - "rake=0.9"
8
+ - "rake=10"
9
+ script: "bundle exec rspec"
10
+ notifications:
11
+ email:
12
+ - dropbox+travis@ricostacruz.com
@@ -0,0 +1,124 @@
1
+ # Contributing to Mina
2
+
3
+ Want to get involved? Thanks! There are plenty of ways to help!
4
+
5
+ ## Reporting issues
6
+
7
+ A bug is a _demonstrable problem_ that is caused by the code in the
8
+ repository.
9
+
10
+ Please read the following guidelines before you [report an issue][issues]:
11
+
12
+ 1. **Use the GitHub issue search** — check if the issue has already been
13
+ reported. If it has been, please comment on the existing issue.
14
+
15
+ 2. **Check if the issue has been fixed** — the latest `master` or
16
+ development branch may already contain a fix.
17
+
18
+ 3. **Isolate the demonstrable problem** — make sure that the code in the
19
+ project's repository is _definitely_ responsible for the issue. Create a
20
+ [reduced test case](http://css-tricks.com/6263-reduced-test-cases/) - an
21
+ extremely simple and immediately viewable example of the issue.
22
+
23
+ Please try to be as detailed as possible in your report too. What is your
24
+ environment? What steps will reproduce the issue? What would you expect to be
25
+ the outcome? All these details will help people to assess and fix any potential
26
+ bugs.
27
+
28
+ ### Example of a good bug report:
29
+
30
+ > Short and descriptive title
31
+ >
32
+ > A summary of the issue and the OS environment in which it occurs. If
33
+ > suitable, include the steps required to reproduce the bug.
34
+ >
35
+ > 1. This is the first step
36
+ > 2. This is the second step
37
+ > 3. Further steps, etc.
38
+ >
39
+ > `<url>` (a link to the reduced test case)
40
+ >
41
+ > Any other information you want to share that is relevant to the issue being
42
+ > reported. This might include the lines of code that you have identified as
43
+ > causing the bug, and potential solutions (and your opinions on their
44
+ > merits).
45
+
46
+ A good bug report shouldn't leave people needing to chase you up to get further
47
+ information that is required to assess or fix the bug.
48
+
49
+ **[File a bug report][issues]**
50
+
51
+ ## Responding to issues
52
+
53
+ Feel free to respond to other people's issues! Some people may be reporting
54
+ issues that can easily be solved even without modification to the project's
55
+ code.
56
+
57
+ You can also help by verifying issues reported.
58
+
59
+ **[View issues][issues]**
60
+
61
+ ## The 'help wanted' tag
62
+
63
+ Some [issues] are tagged with the 'help wanted' tag. These issues often:
64
+
65
+ - are missing an actual implementation, or
66
+ - need people's help in verifying and replicating the issue, or
67
+ - need test cases.
68
+
69
+ If you would like to contribute code and don't have any specific issue you want
70
+ to fix, this would be a good place to start looking at!
71
+
72
+ **[View issues][issues]**
73
+
74
+ ## Pull requests
75
+
76
+ Good pull requests — patches, improvements, new features — are a fantastic
77
+ help. They should remain focused in scope and avoid containing unrelated
78
+ commits.
79
+
80
+ If your contribution involves a significant amount of work or substantial
81
+ changes to any part of the project, please open an issue to discuss it first.
82
+
83
+ Please follow this process; it's the best way to get your work included in the
84
+ project:
85
+
86
+ 1. [Fork](http://help.github.com/fork-a-repo/) the project.
87
+
88
+ 2. Clone your fork (`git clone
89
+ https://github.com/<your-username>/html5-boilerplate.git`).
90
+
91
+ 3. Add an `upstream` remote (`git remote add upstream
92
+ https://github.com/nadarei/mina.git`).
93
+
94
+ 4. Get the latest changes from upstream (e.g. `git pull upstream
95
+ <dev-branch>`).
96
+
97
+ 5. Create a new topic branch to contain your feature, change, or fix (`git
98
+ checkout -b <topic-branch-name>`).
99
+
100
+ 6. Make sure that your changes adhere to the current coding conventions used
101
+ throughout the project - indentation, accurate comments, etc. Please update
102
+ any documentation that is relevant to the change you are making.
103
+
104
+ 7. Commit your changes in logical chunks; use git's [interactive
105
+ rebase](https://help.github.com/articles/interactive-rebase) feature to tidy
106
+ up your commits before making them public. Please adhere to these [git commit
107
+ message
108
+ guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
109
+ or your pull request is unlikely be merged into the main project.
110
+
111
+ 8. Locally merge (or rebase) the upstream branch into your topic branch.
112
+
113
+ 9. Push your topic branch up to your fork (`git push origin
114
+ <topic-branch-name>`).
115
+
116
+ 10. [Open a Pull Request](http://help.github.com/send-pull-requests/) with a
117
+ clear title and description. Please mention which browsers you tested in.
118
+
119
+ ## Acknowledgements
120
+
121
+ This contributing guide has been adapted from [HTML5 boilerplate's guide][g].
122
+
123
+ [g]: https://github.com/h5bp/html5-boilerplate/blob/master/CONTRIBUTING.md
124
+ [issues]: https://github.com/nadarei/mina/issues/
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # Why use bundler?
2
+ # Well, not all development dependencies install on all rubies. Moreover, `gem
3
+ # install mina --development` doesn't work, as it will also try to install
4
+ # development dependencies of our dependencies, and those are not conflict free.
5
+ # So, here we are, `bundle install`.
6
+
7
+ source "https://rubygems.org"
8
+ gemspec
9
+
10
+ gem 'rake', "~> #{ENV['rake'] || "0.9"}.0"
@@ -0,0 +1,304 @@
1
+ v0.3.0 - July 10, 2013
2
+ ----------------------
3
+
4
+ * **Stdin is now being passed, thereby making git prompts work.**
5
+ * Foreman: Add foreman support. (#71) [Dan Sosedoff]
6
+ * Foreman: Fix 'command not found' error. (#89, #101)
7
+ * Foreman: Fix forman stop. [Andrew Rosa]
8
+ * Fix `mina setup` showing an error. (#64) [Anthony Hristov]
9
+ * Fix "broken pipe" error after deploying. (#64) [Tomas Varneckas]
10
+ * Fix error regarding "open4" in Windows environments. (#58)
11
+ * Fix the default script's "touch tmp/restart.txt" to work for reliably. (#77)
12
+ [Eugene Diachkin]
13
+ * Fix errors that happen when the host string is frozen. [sonots]
14
+ * RVM: use 'rvm use --create'. (#81) [Marcos Beirigo]
15
+ * RVM: Add 'rvm:wrapper' task to create wrappers. (#81) [Marcos Beirigo]
16
+ * New helper method called 'capture' to capture SSH output. (#113) [Naoki
17
+ Ainoya]
18
+ * Fix encoding errors. (#68) [Faud Saud]
19
+
20
+ Special thanks to all the contributors who made this release happen.
21
+
22
+ https://github.com/nadarei/mina/compare/v0.2.1...v0.3.0
23
+
24
+ [sonots]: https://github.com/sonots
25
+ [Tomas Varneckas]: https://github.com/tomasv
26
+ [Anthony Hristov]: https://github.com/muxcmux
27
+ [Dan Sosedoff]: https://github.com/sosedoff
28
+ [Eugene Diachkin]: https://github.com/ineu
29
+ [Marcos Beirigo]: https://github.com/marcosbeirigo
30
+ [Andrew Rosa]: https://github.com/andrewhr
31
+ [Naoki Ainoya]: https://github.com/saketoba
32
+ [Faud Saud]: https://github.com/faudsaud
33
+
34
+ v0.2.1 - Sep 08, 2012
35
+ ---------------------
36
+
37
+ This release is to fix some issues that should've been cleaned up in the
38
+ previous release, but wasn't.
39
+
40
+ ### Fixed:
41
+ * **Fix SSH helpers giving a 'class required' error.**
42
+ * **Send stdout even in term_mode = :pretty mode.**
43
+ * Rbenv: Fix compatibility with Debian, Arch, Fedora. (#44)
44
+ * Supress the "--depth is ignored in local clones" warning. (#56)
45
+
46
+ ### Added:
47
+ * Add the `:ssh_options` setting. (#23)
48
+ * Add the `:forward_agent` setting. (#23)
49
+
50
+ ### Changed:
51
+ * Make the `:term_mode` setting accept strings, not just symbols. (eg: `set
52
+ :term_mode, 'exec'`)
53
+
54
+ v0.2.0 - Sep 08, 2012
55
+ ---------------------
56
+
57
+ This release had two pre releases:
58
+
59
+ * v0.2.0.pre2 (Aug 2, 2012)
60
+ * v0.1.3.pre1 (Jul 13, 2012)
61
+
62
+ ### Fixed:
63
+ * Allow changing `:term_mode` in the setup task. (#51, @alfuken)
64
+ * Prevent `git log` from using a pager. (#42, @tmak)
65
+ * `deploy:cleanup` can now be called in a deploy script. (#50, @dariocravero)
66
+ * Don't invoke bash anymore (!), assume that bash is the shell for the user.
67
+ Fixes Ubuntu 12, and many other things.
68
+ * Fixed `ssh(cmd, return: true)` that used to exit. (#53 from @jpascal)
69
+ * [pre2] Call ssh with no double use `-t` parameter.
70
+ * [pre2] Fix Ruby 1.8 compatibility.
71
+ * [pre2] Fix the "undefined method > for Process::Status" error.
72
+ * [pre2] Using `force_migrate=1` and `force_assets=1` to `rails:db_migrate`
73
+ and `rails:assets_precompile` now works well.
74
+ * [pre1] Respect the `bundle_bin` setting when doing `bundle exec` in Rails commands. (#29)
75
+ * [pre1] Doing `rails:assets_precompile` now properly skips asset compilation if not needed. (#25)
76
+
77
+ ### Added:
78
+ * __Added the 'queue!' helper.__
79
+ * Add support for __Whenever__. (#47, @jpascal)
80
+ * Add a new `:environment` task that gets loaded on setup/deploy.
81
+ * __Add explicit support for rbenv/rvm.__ (#5, #39)
82
+ * Implement :'rvm:use[...]'. (#5, #39)
83
+ * Implement :'rbenv:load'. (#5, #39)
84
+ * Revert `rails:optimize_for_3.2` from the pre2 release. (#32)
85
+ * [pre2] __Optimize git:clone by caching the repository.__ This way, updates are
86
+ faster because not the entire repo is cloned everytime. (#10)
87
+ * [pre2] __Show elapsed time that a deploy takes.__
88
+ * [pre2] __Display the git commit nicely when deploying.__
89
+ * [pre2] __Force quit when 2 `^C`s are pressed.__
90
+ * [pre2] New `die` helper.
91
+ * [pre2] New `report_time` helper.
92
+ * [pre2] New `to_directory` helper. (#35)
93
+ * [pre2] Put optional optimizations for Rails 3.2 asset pipeline. (#32) -- reverted
94
+ * Update sample deploy script:
95
+ - [pre2] Update default deploy.rb to note :branch.
96
+ - [pre2] Add `link_shared_paths` to the sample deploy script.
97
+ * [pre1] Doing `rails:db_migrate` now skips doing migrations if they're not needed. (#18)
98
+ * [pre1] Added the `mina console` command for Rails.
99
+ * [pre1] Make asset paths configurable using the `asset_paths` setting.
100
+
101
+ ### Changed:
102
+ * Force removal of shared path destinations before linking with
103
+ `deploy:link_shared_paths`. Fixes symlinking of `log/` in Rails projects.
104
+ * __Rails: speed up default asset compilation a bit by invoking
105
+ `assets:precompile` with `RAILS_GROUPS=assets`.__
106
+ * Add helpful error message when there is a problem with
107
+ deploy.rb or a custom Rakefile. (#37, @sge-jesse-adams)
108
+ * Update the default deploy.rb to add notes about 'mina setup' customizations.
109
+ * Make `mina run`, `mina rake`, `mina console` use the new `:environment` task.
110
+ * Allow calling `die` without arguments.
111
+ * [pre2] __Improve output of `mina init`.__
112
+ * [pre2] Prettier output for `mina setup`. Also, show a better error message for it.
113
+ * [pre1] Refactor pretty printing to be simpler, cleaner, and extensible.
114
+ * [pre1] Show prettier abort messages when ^C'd.
115
+
116
+ v0.1.2 - Jul 06, 2012
117
+ ---------------------
118
+
119
+ This release had two prereleases: v0.1.2.pre1 and v0.1.2.pre2.
120
+
121
+ ### Fixed:
122
+ * __Show stdout output properly on deploy.__
123
+ * 'mina rake' now works.
124
+ * [.pre2] __Fix `deploy:link_shared_paths` to use absolute paths.__
125
+ * [.pre2] Fix console logs for task init.
126
+ * [.pre1] __Fixed JRuby support.__
127
+ * [.pre1] __Respect .bashrc.__ (#5)
128
+
129
+ ### Added:
130
+ * [.pre2] Add `:bundle_bin` option.
131
+ * [.pre2] Add `:ssh` port option.
132
+
133
+ ### Changed: (v0.1.2)
134
+ * Refactor pretty printing to be simpler, cleaner, and extensible.
135
+ * Show prettier abort messages when ^C'd.
136
+ * Use the new error message format. (See lib/mina/output_helpers.rb)
137
+ * [.pre1] Implement `ssh("..", return: true)`.
138
+ * [.pre1] Rename `simulate_mode` to `simulate_mode?`. Same with `verbose_mode?`.
139
+ * [.pre1] Show the SSH command in the simulation output.
140
+
141
+ v0.1.1 - Jun 07, 2012
142
+ ---------------------
143
+
144
+ ### Added:
145
+ * Check for releases_path directory in deploy script.
146
+ * mina deploy:cleanup
147
+ * Support for -f option.
148
+
149
+ ### Changed:
150
+ * Gem description.
151
+
152
+ ### Fixed:
153
+ * deploy.rb template (domain, user, git:clone).
154
+ * Handle empty Git repository.
155
+ * Add pkg to gitignore.
156
+
157
+ v0.1.0 - Jun 06, 2012
158
+ ---------------------
159
+
160
+ Renamed to Mina from Van Helsing.
161
+
162
+
163
+ v0.0.1.pre7 - Jun 06, 2012
164
+ --------------------------
165
+
166
+ ### Added:
167
+ * __`vh rails[command]` and `vh rake[command]` tasks.__
168
+ * __Add `vh run`.__
169
+ * `-S` as an alias for `--simulate`.
170
+ * the `#set_default` helper.
171
+ * the `bundle_prefix` setting.
172
+ * New `term_mode` setting.
173
+
174
+ ### Changed:
175
+ * `--simulate` show things without the `ssh` command or shellescaping.
176
+
177
+ v0.0.1.pre6 - Jun 06, 2012
178
+ --------------------------
179
+
180
+ Thanks to @sosedoff for his contributions that made it to this release.
181
+
182
+ ### Added:
183
+ * __Rubinius support.__
184
+ * __Ruby 1.8 support.__
185
+ * Prelimenary JRuby support.
186
+ * MIT license.
187
+ * Highlight errors as red in deploy.
188
+ * Use popen4 instead of popen3. Support JRuby via IO.popen4.
189
+
190
+ ### Changed:
191
+ * __Rename `to :restart` to `to :launch`.__
192
+ * __Make deploys fail if renaming the build (eg, not setup properly) fails.__
193
+
194
+ ### Tests:
195
+ * Added `rake spec` (aliased as just `rake`) task. It tests with Rake 0.8 and 0.9 both.
196
+ * Integrate with [Travis CI](http://travis-ci.org).
197
+ * Make the SSH test more portable.
198
+ * Removed `rake spec:verbose`.
199
+
200
+ v0.0.1.pre5 - Jun 05, 2012
201
+ --------------------------
202
+
203
+ ### Added:
204
+ * Add `--trace` to the `vh help` screen.
205
+ * Rake 0.8 compatibility.
206
+ * Ruby 1.8.7 compatibility.
207
+
208
+ ### Changed:
209
+ * Use `:domain` instead of `:host`.
210
+
211
+ ### Misc:
212
+ * Allow rake 0.8 testing using `rake=0.8 rspec`.
213
+ * Add more README examples.
214
+
215
+ v0.0.1.pre4 - Jun 05, 2012
216
+ --------------------------
217
+
218
+ ### Added:
219
+ * `--simulate` switch.
220
+ * `--verbose` switch.
221
+ * The help screen now shows command line switches (like `--verbose`).
222
+ * Build in `tmp/` instead of in `releases/`.
223
+ * Use `verbose_mode` and `simulate_mode` instead. Using 'verbose' causes
224
+ problems.
225
+ * New `#deploy_script` helper, to make things more transparent.
226
+
227
+ ### Misc:
228
+ * Added a test for an actual deployment.
229
+ * Make the `test_env` runnable even without a net connection.
230
+ * New tests for actual deployment. Just do `rspec -t ssh`.
231
+ * Cleanup `git:clone` code.
232
+ * A buncha code cleanups.
233
+
234
+ v0.0.1.pre3 - Jun 04, 2012
235
+ --------------------------
236
+
237
+ ### Added:
238
+ * A help screen. You can see it with `vh --help`, `vh -h` or just plain `vh`.
239
+ * Implemented `vh --version`.
240
+ * Sequential release versions. Yay!
241
+ * Added the `build_path` setting, which supercedes the now-removed `release_path`.
242
+
243
+ ### Removed:
244
+ * `release_path` has been deprecated.
245
+
246
+ ### Fixed:
247
+ * Stupid critical bug fix: fix `vh:setup` giving the world access to deploy_to.
248
+ * Ensure that SSH stderr output is shown properly.
249
+ * Make `#invoke` work with tasks with arguments (eg, :'site:scrape[ensogo]')
250
+
251
+ ### Changed:
252
+ * Edit the default deploy.rb to have a description for the deploy task.
253
+ * Make `vh -T` show `vh` instead of `rake`.
254
+ * Make `vh setup` ensure ownership of the `deploy_to` path.
255
+ * Make deploy steps more explicit by echoing more statuses.
256
+ * When deploys fail, you now don't see the default Ruby backtrace. It now
257
+ behaves like Rake where you need to add `--trace` to see the trace.
258
+
259
+ ### Misc:
260
+ * Fixed the error that sometimes happens when invoking `vh` without a deploy.rb.
261
+ * Update the sample deploy.rb file to be more readable.
262
+ * The *test_env/* project can now be deployed without problems, so you can try
263
+ things out.
264
+ * Lots of new tests.
265
+ * rspec test order is now randomized.
266
+ * rspec output is colored (thanks to .rspec).
267
+ * Better script indentation when running in simulation mode.
268
+ * In symlinking `./current/`, use `ln -nfs` instead of `rm -f && ln -s`.
269
+
270
+ v0.0.1.pre2 - Jun 03, 2012
271
+ --------------------------
272
+
273
+ ### Added:
274
+ * Implement `vh init` which creates a sample *deploy.rb*.
275
+ * Implement 'vh setup'.
276
+ * Added the configurable `:releases_path` setting, so you may change where to keep releases.
277
+ * Added documentation via Reacco.
278
+ * Allow settings to throw errors on missing settings by adding a bang (e.g.,
279
+ `bundle_path!` or `settings.bundle_path!`)
280
+
281
+ ### Changed:
282
+ * Allow `bundle:install` to skip having shared bundle paths if `:bundle_path` is set to nil.
283
+ * Rename `force_unlock` to `deploy:force_unlock`.
284
+ * Rename `vh:link_shared_paths` to `deploy:link_shared_paths`.
285
+ * Invoking `deploy:force_unlock` now shows the command it uses.
286
+
287
+ ### Fixed:
288
+ * The `bundle:install` task now honors the `bundle_path` setting.
289
+ * Fixed `deploy:force_unlock` always throwing an error.
290
+ * The `deploy:force_unlock` task now honors the `lock_file`
291
+ setting, so the user may change the location of the lock file.
292
+ * Fixed `rails:assets_precompile` not compiling if no older assets found.
293
+
294
+ ### Removed:
295
+ * Deprecate `#validate_set`.
296
+
297
+ ### Other things:
298
+ * Move deploy settings to deploy.rb.
299
+ * Rename the `default` addon to `deploy`.
300
+
301
+ v0.0.1.pre1 - Jun 02, 2012
302
+ --------------------------
303
+
304
+ Initial version.