[DRE-commits] [ruby-mina] 01/04: Imported Upstream version 0.3.7
Aggelos Avgerinos
avgerinos-guest at moszumanska.debian.org
Fri Dec 18 15:15:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
avgerinos-guest pushed a commit to branch master
in repository ruby-mina.
commit 57a5585000d52a0f7ab9738b19d4b8c468309577
Author: Aggelos Avgerinos <avgerinos at skroutz.gr>
Date: Fri Dec 18 16:00:56 2015 +0200
Imported Upstream version 0.3.7
---
.travis.yml | 4 +-
CHANGELOG.md | 671 ++++++++++++++++++++++++++
HISTORY.md | 48 +-
Makefile | 3 +
Readme.md | 175 ++++++-
data/deploy.rb | 18 +-
data/deploy.sh.erb | 22 +-
lib/mina.rb | 1 +
lib/mina/default.rb | 13 +
lib/mina/deploy.rb | 24 +-
lib/mina/foreman.rb | 3 +-
lib/mina/git.rb | 7 +
lib/mina/helpers.rb | 28 +-
lib/mina/{ssh_helpers.rb => local_helpers.rb} | 84 ++--
lib/mina/npm.rb | 89 ++++
lib/mina/rails.rb | 51 +-
lib/mina/rake.rb | 1 +
lib/mina/ry.rb | 55 +++
lib/mina/ssh_helpers.rb | 4 +-
lib/mina/version.rb | 2 +-
lib/mina/whenever.rb | 39 +-
metadata.yml | 159 +++---
mina.gemspec | 1 +
spec/commands/deploy_spec.rb | 4 +
spec/commands/real_deploy_spec.rb | 3 +
spec/dsl/invoke_spec.rb | 1 +
spec/helpers/local_helper_spec.rb | 70 +++
spec/spec_helper.rb | 1 +
support/Readme-footer.md | 7 +-
support/Readme-header.md | 2 +-
support/guide.md | 2 +-
support/third_party_modules.md | 23 +
test_env/config/deploy.rb | 30 +-
33 files changed, 1450 insertions(+), 195 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 016724e..f6d67d6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,6 +16,6 @@ env:
script: "bundle exec rspec"
notifications:
email:
- - dropbox+travis at ricostacruz.com
- - dario at uxtemple.com
- gabrijel.skoro at infinum.hr
+ - stjepan.hadjic at infinum.hr
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..73f9f89
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,671 @@
+# Change Log
+
+## [v0.3.6](https://github.com/mina-deploy/mina/tree/v0.3.6) (2015-07-05)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.3.4...v0.3.6)
+
+**Closed issues:**
+
+- master failed to start, check stderr log for details [\#322](https://github.com/mina-deploy/mina/issues/322)
+
+- can not connect to VPS [\#319](https://github.com/mina-deploy/mina/issues/319)
+
+- Integrate with sitemap generator. [\#313](https://github.com/mina-deploy/mina/issues/313)
+
+- Mina ssh doesn't load bash\_profile? [\#311](https://github.com/mina-deploy/mina/issues/311)
+
+- Mina::LocalHelpers::Local.invoke is broken for non-pretty term modes [\#309](https://github.com/mina-deploy/mina/issues/309)
+
+- sudo command in configuration [\#302](https://github.com/mina-deploy/mina/issues/302)
+
+- Why does rails:db\_migrate run on the previous release? [\#300](https://github.com/mina-deploy/mina/issues/300)
+
+- secrets.yml in shared\_paths by default [\#298](https://github.com/mina-deploy/mina/issues/298)
+
+- mina don't support deployment by tag [\#296](https://github.com/mina-deploy/mina/issues/296)
+
+- when Skipping asset precompilation, it copied assets to wrong path [\#293](https://github.com/mina-deploy/mina/issues/293)
+
+- Mina chokes handling STDIN [\#286](https://github.com/mina-deploy/mina/issues/286)
+
+- invoke does not work after a to block [\#285](https://github.com/mina-deploy/mina/issues/285)
+
+- Deploy locked without deploy.lock file [\#283](https://github.com/mina-deploy/mina/issues/283)
+
+- mina setup improperly documented [\#280](https://github.com/mina-deploy/mina/issues/280)
+
+- Hangs on confirming host key phase. [\#277](https://github.com/mina-deploy/mina/issues/277)
+
+- Whenever tasks do not dependent :environment [\#267](https://github.com/mina-deploy/mina/issues/267)
+
+- Can I safely embed `.env` in the Mina deploy script? [\#265](https://github.com/mina-deploy/mina/issues/265)
+
+- to :launch ... [\#261](https://github.com/mina-deploy/mina/issues/261)
+
+- Mina - Foreman - Bundle problem [\#257](https://github.com/mina-deploy/mina/issues/257)
+
+- :preapre stage to happen before creating a new temp build [\#256](https://github.com/mina-deploy/mina/issues/256)
+
+- How can i deploy thinking\_sphinx [\#250](https://github.com/mina-deploy/mina/issues/250)
+
+- logfile on server? [\#242](https://github.com/mina-deploy/mina/issues/242)
+
+- Starting a resque worker [\#223](https://github.com/mina-deploy/mina/issues/223)
+
+- Multiple Server Support / Timestamp Release Support [\#217](https://github.com/mina-deploy/mina/issues/217)
+
+- Installing gems on JRuby [\#211](https://github.com/mina-deploy/mina/issues/211)
+
+- Deploy fails with 'cannot create directory' [\#205](https://github.com/mina-deploy/mina/issues/205)
+
+- Checkout to HEAD? [\#203](https://github.com/mina-deploy/mina/issues/203)
+
+- Alter the setup task [\#202](https://github.com/mina-deploy/mina/issues/202)
+
+- "invoke :task, reenable: true" doesn't work in certain configurations [\#201](https://github.com/mina-deploy/mina/issues/201)
+
+- Simple `mina git:clone` fails on step "Using git branch 'master'" [\#200](https://github.com/mina-deploy/mina/issues/200)
+
+- ssh command assumes the user's shell on the server is bashish [\#199](https://github.com/mina-deploy/mina/issues/199)
+
+- Mina support mercurial? [\#192](https://github.com/mina-deploy/mina/issues/192)
+
+- git clone '.' path already exists [\#190](https://github.com/mina-deploy/mina/issues/190)
+
+- mina deploy error [\#187](https://github.com/mina-deploy/mina/issues/187)
+
+- current\_path up one directory breaks current symlink [\#180](https://github.com/mina-deploy/mina/issues/180)
+
+- Why don't you also read the `.bash\_profile`? [\#176](https://github.com/mina-deploy/mina/issues/176)
+
+- deploy\_to does not expand path [\#174](https://github.com/mina-deploy/mina/issues/174)
+
+- shared bundle path not symlinked [\#156](https://github.com/mina-deploy/mina/issues/156)
+
+- How to select project folder under git control [\#155](https://github.com/mina-deploy/mina/issues/155)
+
+- Add support for ssh proxies [\#151](https://github.com/mina-deploy/mina/issues/151)
+
+- Broken JRuby support [\#147](https://github.com/mina-deploy/mina/issues/147)
+
+- Changes of assets under lib/assets does not trigger assets\_precompile [\#143](https://github.com/mina-deploy/mina/issues/143)
+
+- can't convert Fixnum into String [\#142](https://github.com/mina-deploy/mina/issues/142)
+
+- mina console with dvm [\#141](https://github.com/mina-deploy/mina/issues/141)
+
+- Enable wiki to list plugins/gems [\#140](https://github.com/mina-deploy/mina/issues/140)
+
+- rvm is sourced, which just prints the help message [\#131](https://github.com/mina-deploy/mina/issues/131)
+
+- When config.assets.prefix was setting, the assets was precompiled every deploy [\#125](https://github.com/mina-deploy/mina/issues/125)
+
+- rvm\_path setting not picking up [\#124](https://github.com/mina-deploy/mina/issues/124)
+
+- Whenever support: fix 'bundle exec' [\#114](https://github.com/mina-deploy/mina/issues/114)
+
+- Why my rvm gemset is empty? [\#108](https://github.com/mina-deploy/mina/issues/108)
+
+- when using verbose strict encoding conversion is required [\#107](https://github.com/mina-deploy/mina/issues/107)
+
+- Export RBENV\_ROOT before rbenv init for system-wide install [\#106](https://github.com/mina-deploy/mina/issues/106)
+
+- Do some tasks after deploy [\#98](https://github.com/mina-deploy/mina/issues/98)
+
+- trying to fix permission for tmp directory [\#92](https://github.com/mina-deploy/mina/issues/92)
+
+- how to run mina deploy with sudo? [\#86](https://github.com/mina-deploy/mina/issues/86)
+
+- Early Deletion of .git repo [\#80](https://github.com/mina-deploy/mina/issues/80)
+
+- symlink to current is broken [\#79](https://github.com/mina-deploy/mina/issues/79)
+
+- Asset precompilation skip issue [\#60](https://github.com/mina-deploy/mina/issues/60)
+
+- ln -sfn is NOT atomic [\#16](https://github.com/mina-deploy/mina/issues/16)
+
+**Merged pull requests:**
+
+- Suggest force\_unlock when deploy.lock file exists [\#327](https://github.com/mina-deploy/mina/pull/327) ([stevendaniels](https://github.com/stevendaniels))
+
+- added support for ry [\#315](https://github.com/mina-deploy/mina/pull/315) ([kmmndr](https://github.com/kmmndr))
+
+- Fix for \#309 [\#310](https://github.com/mina-deploy/mina/pull/310) ([13k](https://github.com/13k))
+
+- Save deployed git sha in deploy/current/.mina\_git\_revision [\#306](https://github.com/mina-deploy/mina/pull/306) ([gaizka](https://github.com/gaizka))
+
+- Reorder die parameters [\#281](https://github.com/mina-deploy/mina/pull/281) ([Bilge](https://github.com/Bilge))
+
+- Allow you to optionally set an alternate procfile name [\#275](https://github.com/mina-deploy/mina/pull/275) ([henare](https://github.com/henare))
+
+- Ability to customise Rails' public assets path [\#266](https://github.com/mina-deploy/mina/pull/266) ([dwfait](https://github.com/dwfait))
+
+- Fix host verification error at first deploy if repo is not included to the list of known hosts [\#263](https://github.com/mina-deploy/mina/pull/263) ([flowerett](https://github.com/flowerett))
+
+- Treat absent files as empty when changes script [\#230](https://github.com/mina-deploy/mina/pull/230) ([rodolfospalenza](https://github.com/rodolfospalenza))
+
+- Allow for a build step [\#178](https://github.com/mina-deploy/mina/pull/178) ([dchancogne](https://github.com/dchancogne))
+
+- Use `set -e` to fail fast [\#111](https://github.com/mina-deploy/mina/pull/111) ([5long](https://github.com/5long))
+
+## [v0.3.4](https://github.com/mina-deploy/mina/tree/v0.3.4) (2015-03-27)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.3.3...v0.3.4)
+
+**Closed issues:**
+
+- More control on command verbosity [\#294](https://github.com/mina-deploy/mina/issues/294)
+
+- db\_migrate not migrating [\#292](https://github.com/mina-deploy/mina/issues/292)
+
+- Best way to reload nginx.conf [\#291](https://github.com/mina-deploy/mina/issues/291)
+
+- bash : bundle: command not found [\#290](https://github.com/mina-deploy/mina/issues/290)
+
+- Mina deploy: I have set up SSH, but can't connect to git at github.com [\#288](https://github.com/mina-deploy/mina/issues/288)
+
+- Issue on loading an ENV variables in \*.yml files [\#269](https://github.com/mina-deploy/mina/issues/269)
+
+## [v0.3.3](https://github.com/mina-deploy/mina/tree/v0.3.3) (2015-03-10)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.3.2...v0.3.3)
+
+**Closed issues:**
+
+- Error while precompiling assets \*\*bash: line 232: 21006 Killed\*\* [\#282](https://github.com/mina-deploy/mina/issues/282)
+
+- unable to run rails console [\#279](https://github.com/mina-deploy/mina/issues/279)
+
+- Setup task should not be trying to chown or chmod [\#278](https://github.com/mina-deploy/mina/issues/278)
+
+- Unicorn not starting when using mina [\#272](https://github.com/mina-deploy/mina/issues/272)
+
+- Prevent queue method to display output [\#268](https://github.com/mina-deploy/mina/issues/268)
+
+- RVM is not a function [\#262](https://github.com/mina-deploy/mina/issues/262)
+
+- Rolling back to previous release [\#9](https://github.com/mina-deploy/mina/issues/9)
+
+**Merged pull requests:**
+
+- Fix up formatting of code block in readme [\#274](https://github.com/mina-deploy/mina/pull/274) ([henare](https://github.com/henare))
+
+- Fix link typo in readme [\#273](https://github.com/mina-deploy/mina/pull/273) ([henare](https://github.com/henare))
+
+## [v0.3.2](https://github.com/mina-deploy/mina/tree/v0.3.2) (2015-01-24)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.3.1...v0.3.2)
+
+**Closed issues:**
+
+- Didn't get the current folder after mina setup [\#264](https://github.com/mina-deploy/mina/issues/264)
+
+- git pull instead of git clone [\#259](https://github.com/mina-deploy/mina/issues/259)
+
+- How do I run rake tasks before the current symlink is created? [\#255](https://github.com/mina-deploy/mina/issues/255)
+
+- rbenv system-wide install [\#253](https://github.com/mina-deploy/mina/issues/253)
+
+- link\_shared\_paths links to user folder [\#248](https://github.com/mina-deploy/mina/issues/248)
+
+- Deploy failed 'no tty present', but no sudo? [\#247](https://github.com/mina-deploy/mina/issues/247)
+
+- Skipping asset precompilation: wrong copy paths [\#246](https://github.com/mina-deploy/mina/issues/246)
+
+- problems with restarting puma [\#245](https://github.com/mina-deploy/mina/issues/245)
+
+- mina/foreman does not work due to sudo [\#233](https://github.com/mina-deploy/mina/issues/233)
+
+- \[solved\] Initial deploy after installing 'whenever' gem: "...whenever is not part of the bundle. Add it to Gemfile." [\#231](https://github.com/mina-deploy/mina/issues/231)
+
+- During launch stage, current symlink points to previous release [\#224](https://github.com/mina-deploy/mina/issues/224)
+
+- link\_shared\_paths don't execute [\#210](https://github.com/mina-deploy/mina/issues/210)
+
+- Is there a plan to release a new version? [\#206](https://github.com/mina-deploy/mina/issues/206)
+
+- Update shared paths [\#188](https://github.com/mina-deploy/mina/issues/188)
+
+- Deployment with Github WebHook URLs.. [\#165](https://github.com/mina-deploy/mina/issues/165)
+
+**Merged pull requests:**
+
+- 3rd party modules [\#258](https://github.com/mina-deploy/mina/pull/258) ([stereodenis](https://github.com/stereodenis))
+
+- Fix link in the support guide [\#254](https://github.com/mina-deploy/mina/pull/254) ([jartek](https://github.com/jartek))
+
+- mention .ruby-version for rbenv comment [\#249](https://github.com/mina-deploy/mina/pull/249) ([equivalent](https://github.com/equivalent))
+
+- Add npm support with a simple npm:install task [\#227](https://github.com/mina-deploy/mina/pull/227) ([paulRbr](https://github.com/paulRbr))
+
+- Make rails console task dependent on the environment [\#220](https://github.com/mina-deploy/mina/pull/220) ([lucapette](https://github.com/lucapette))
+
+- Adding support for server environment variables in deploy.rb, \(:env\_vars\) [\#161](https://github.com/mina-deploy/mina/pull/161) ([pricees](https://github.com/pricees))
+
+- Added `mina ssh` command to connect to server [\#139](https://github.com/mina-deploy/mina/pull/139) ([adie](https://github.com/adie))
+
+## [v0.3.1](https://github.com/mina-deploy/mina/tree/v0.3.1) (2014-10-17)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.3.0...v0.3.1)
+
+**Fixed bugs:**
+
+- Rails schema\_format = :sql makes Mina never migrate the database [\#74](https://github.com/mina-deploy/mina/issues/74)
+
+**Closed issues:**
+
+- mina deploy --help should not cause a deploy [\#238](https://github.com/mina-deploy/mina/issues/238)
+
+- migrations aren't being run [\#236](https://github.com/mina-deploy/mina/issues/236)
+
+- mina/foreman should not call sudo to start/stop/restart foreman [\#234](https://github.com/mina-deploy/mina/issues/234)
+
+- Cleanup not run after deploy [\#218](https://github.com/mina-deploy/mina/issues/218)
+
+- git:clone on win7 x64 had error [\#216](https://github.com/mina-deploy/mina/issues/216)
+
+- Integration with Rollbar? [\#215](https://github.com/mina-deploy/mina/issues/215)
+
+- Carrierwave: how to share public/uploads path? [\#214](https://github.com/mina-deploy/mina/issues/214)
+
+- Should tmp dir be shared? [\#213](https://github.com/mina-deploy/mina/issues/213)
+
+- How to display logs when I call the mina system command continuously in my sinatra app? [\#209](https://github.com/mina-deploy/mina/issues/209)
+
+- mistypen exit\_status in bin/mina [\#198](https://github.com/mina-deploy/mina/issues/198)
+
+- set :keep\_releases does not work [\#196](https://github.com/mina-deploy/mina/issues/196)
+
+- Wrong assets path when precompilation i skipped [\#193](https://github.com/mina-deploy/mina/issues/193)
+
+- rake db:migrate fails to run on first deploy [\#191](https://github.com/mina-deploy/mina/issues/191)
+
+- Installing Mina on Debian [\#186](https://github.com/mina-deploy/mina/issues/186)
+
+- Dead project? [\#181](https://github.com/mina-deploy/mina/issues/181)
+
+- "to :launch" creates restart.txt in the wrong directory [\#175](https://github.com/mina-deploy/mina/issues/175)
+
+- Nothing happens when running "mina setup" [\#172](https://github.com/mina-deploy/mina/issues/172)
+
+- launch block don't works [\#170](https://github.com/mina-deploy/mina/issues/170)
+
+- AWS EC2 .pem file [\#164](https://github.com/mina-deploy/mina/issues/164)
+
+- mina setup freezes at password [\#163](https://github.com/mina-deploy/mina/issues/163)
+
+- Rails 4 and binstubs [\#162](https://github.com/mina-deploy/mina/issues/162)
+
+- Migrating database fail [\#160](https://github.com/mina-deploy/mina/issues/160)
+
+- sudo: no tty present and no askpass program specified [\#157](https://github.com/mina-deploy/mina/issues/157)
+
+- Zero downtime deploys [\#152](https://github.com/mina-deploy/mina/issues/152)
+
+- Question: Mina Deploy Precompile Error [\#146](https://github.com/mina-deploy/mina/issues/146)
+
+- How to refactor \(?\) a long deploy.rb [\#145](https://github.com/mina-deploy/mina/issues/145)
+
+- foreman module exports using the development environment [\#135](https://github.com/mina-deploy/mina/issues/135)
+
+- `mina deploy` hangs [\#134](https://github.com/mina-deploy/mina/issues/134)
+
+- How to restart nginx without enter password like you [\#129](https://github.com/mina-deploy/mina/issues/129)
+
+- Release new gem version [\#122](https://github.com/mina-deploy/mina/issues/122)
+
+- Problem with rake db:migrate [\#121](https://github.com/mina-deploy/mina/issues/121)
+
+- Mina hangs after entering SSH password [\#88](https://github.com/mina-deploy/mina/issues/88)
+
+- \[Bug\] Precompile Assets with JRuby [\#29](https://github.com/mina-deploy/mina/issues/29)
+
+**Merged pull requests:**
+
+- Prevent foreman export from expanding the current/ symlink [\#241](https://github.com/mina-deploy/mina/pull/241) ([postmodern](https://github.com/postmodern))
+
+- Ruby 1.8.7 doesn't support empty symbols [\#240](https://github.com/mina-deploy/mina/pull/240) ([PChambino](https://github.com/PChambino))
+
+- Add foreman\_location and foreman\_sudo configs [\#239](https://github.com/mina-deploy/mina/pull/239) ([PChambino](https://github.com/PChambino))
+
+- Support pretty\_system on Ruby 1.8.7 [\#237](https://github.com/mina-deploy/mina/pull/237) ([PChambino](https://github.com/PChambino))
+
+- Updated deploy.rb template to use shared\_path [\#235](https://github.com/mina-deploy/mina/pull/235) ([postmodern](https://github.com/postmodern))
+
+- Allow the foreman export format to be configurable. [\#232](https://github.com/mina-deploy/mina/pull/232) ([postmodern](https://github.com/postmodern))
+
+- Make tmp directory if it doesn't exist [\#229](https://github.com/mina-deploy/mina/pull/229) ([dvdhsu](https://github.com/dvdhsu))
+
+- Update doc on \#invoke helper [\#226](https://github.com/mina-deploy/mina/pull/226) ([paulRbr](https://github.com/paulRbr))
+
+- Revert "fix tmp/restart.txt path" [\#225](https://github.com/mina-deploy/mina/pull/225) ([gabskoro](https://github.com/gabskoro))
+
+- Remove binstubs options from defaults [\#219](https://github.com/mina-deploy/mina/pull/219) ([lucapette](https://github.com/lucapette))
+
+- fix: bin/mina exit\_status -\> exitstatus [\#212](https://github.com/mina-deploy/mina/pull/212) ([Zhomart](https://github.com/Zhomart))
+
+- fix tmp/restart.txt path [\#208](https://github.com/mina-deploy/mina/pull/208) ([zigomir](https://github.com/zigomir))
+
+- add rescue for rubinius SignalException [\#204](https://github.com/mina-deploy/mina/pull/204) ([qen](https://github.com/qen))
+
+- Update .travis.yml [\#197](https://github.com/mina-deploy/mina/pull/197) ([lucianosousa](https://github.com/lucianosousa))
+
+- Using `bundle\_bin` instead `bundle` in whenever tasks. [\#195](https://github.com/mina-deploy/mina/pull/195) ([mdorfin](https://github.com/mdorfin))
+
+- Convert specs to RSpec expect syntax with transpec [\#194](https://github.com/mina-deploy/mina/pull/194) ([loganhasson](https://github.com/loganhasson))
+
+- Parse task string to reenable task [\#189](https://github.com/mina-deploy/mina/pull/189) ([PChambino](https://github.com/PChambino))
+
+- tense fix [\#184](https://github.com/mina-deploy/mina/pull/184) ([brandondrew](https://github.com/brandondrew))
+
+- Check db/migrate/ instead of schema.rb [\#177](https://github.com/mina-deploy/mina/pull/177) ([chuckd](https://github.com/chuckd))
+
+- Fix typo [\#173](https://github.com/mina-deploy/mina/pull/173) ([Bounga](https://github.com/Bounga))
+
+- Fix typo in Rake url [\#168](https://github.com/mina-deploy/mina/pull/168) ([jfcartkeep](https://github.com/jfcartkeep))
+
+- Fix copy command for assets [\#150](https://github.com/mina-deploy/mina/pull/150) ([joshdover](https://github.com/joshdover))
+
+- stop using fork, which means JRuby support [\#148](https://github.com/mina-deploy/mina/pull/148) ([mrbrdo](https://github.com/mrbrdo))
+
+- Fix directory-structure anchor [\#137](https://github.com/mina-deploy/mina/pull/137) ([christophermanning](https://github.com/christophermanning))
+
+- Set RBENV\_ROOT [\#136](https://github.com/mina-deploy/mina/pull/136) ([trkoch](https://github.com/trkoch))
+
+- Use consistent precision for time measurements. [\#133](https://github.com/mina-deploy/mina/pull/133) ([alloy-d](https://github.com/alloy-d))
+
+- fixed 404 to foreman, changed link [\#132](https://github.com/mina-deploy/mina/pull/132) ([taxaos](https://github.com/taxaos))
+
+- Update Readme.md [\#130](https://github.com/mina-deploy/mina/pull/130) ([vredniy](https://github.com/vredniy))
+
+- Include full path in edit message [\#128](https://github.com/mina-deploy/mina/pull/128) ([nathanbertram](https://github.com/nathanbertram))
+
+- Using rails env in whenever [\#127](https://github.com/mina-deploy/mina/pull/127) ([Reprazent](https://github.com/Reprazent))
+
+- Bundler: Allow configuration of groups to be skipped during installation [\#123](https://github.com/mina-deploy/mina/pull/123) ([luislavena](https://github.com/luislavena))
+
+- Correct Ruby 1.9 Hash syntax [\#116](https://github.com/mina-deploy/mina/pull/116) ([luislavena](https://github.com/luislavena))
+
+- Support for chruby [\#115](https://github.com/mina-deploy/mina/pull/115) ([zaiste](https://github.com/zaiste))
+
+- Add comment for system-wide RVM install. [\#112](https://github.com/mina-deploy/mina/pull/112) ([samqiu](https://github.com/samqiu))
+
+- \[✔\] Fixed “print\_error”. [\#105](https://github.com/mina-deploy/mina/pull/105) ([mkempe](https://github.com/mkempe))
+
+- Incorrect exit status if deploy fails [\#95](https://github.com/mina-deploy/mina/pull/95) ([borovsky](https://github.com/borovsky))
+
+- Properly fixed tmp/restart issue [\#93](https://github.com/mina-deploy/mina/pull/93) ([ineu](https://github.com/ineu))
+
+## [v0.3.0](https://github.com/mina-deploy/mina/tree/v0.3.0) (2013-07-10)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.2.1...v0.3.0)
+
+**Closed issues:**
+
+- Identity file \[/home/candidosg/.ec2/mirafloris.pem\] not accessible: No such file or directory. [\#120](https://github.com/mina-deploy/mina/issues/120)
+
+- Still maintained? [\#118](https://github.com/mina-deploy/mina/issues/118)
+
+- mina/foreman is not wokring [\#100](https://github.com/mina-deploy/mina/issues/100)
+
+- Password prompt in mina doesn't work [\#99](https://github.com/mina-deploy/mina/issues/99)
+
+- invoke "whenever" tasks [\#97](https://github.com/mina-deploy/mina/issues/97)
+
+- link to current doesn't work if someboyd has the current as working directory [\#96](https://github.com/mina-deploy/mina/issues/96)
+
+- Deploy to a Vagrant box locally [\#94](https://github.com/mina-deploy/mina/issues/94)
+
+- Mina aborts during setup [\#91](https://github.com/mina-deploy/mina/issues/91)
+
+- First deploy to a server fails if repo is not included to the list of known hosts [\#90](https://github.com/mina-deploy/mina/issues/90)
+
+- Command runs during deploy, but not when called independently [\#82](https://github.com/mina-deploy/mina/issues/82)
+
+- Could not location Gemfile for rails tasks [\#73](https://github.com/mina-deploy/mina/issues/73)
+
+- Testing against rake 10 [\#70](https://github.com/mina-deploy/mina/issues/70)
+
+- Local shell commands [\#69](https://github.com/mina-deploy/mina/issues/69)
+
+- Git commit message with non ASCII character raises error [\#68](https://github.com/mina-deploy/mina/issues/68)
+
+- Delayed Job [\#66](https://github.com/mina-deploy/mina/issues/66)
+
+- How to ENV variables [\#65](https://github.com/mina-deploy/mina/issues/65)
+
+- Support for multi-stage deployment [\#62](https://github.com/mina-deploy/mina/issues/62)
+
+- Can not access Rails from within Mina tasks [\#61](https://github.com/mina-deploy/mina/issues/61)
+
+- Mina does not work on windows due to open4 gem [\#58](https://github.com/mina-deploy/mina/issues/58)
+
+- Locally cached git repository [\#28](https://github.com/mina-deploy/mina/issues/28)
+
+- Support for SVN [\#12](https://github.com/mina-deploy/mina/issues/12)
+
+- working with rbenv/rvm etc? [\#5](https://github.com/mina-deploy/mina/issues/5)
+
+**Merged pull requests:**
+
+- Add helper method "capture", to get the output of ssh commands simply. [\#113](https://github.com/mina-deploy/mina/pull/113) ([ainoya](https://github.com/ainoya))
+
+- Fix keep\_releases bug [\#103](https://github.com/mina-deploy/mina/pull/103) ([rex79](https://github.com/rex79))
+
+- Fix "can't modify frozen String" occurred in \#ssh\_command [\#102](https://github.com/mina-deploy/mina/pull/102) ([sonots](https://github.com/sonots))
+
+- Fix \#84 command not found [\#89](https://github.com/mina-deploy/mina/pull/89) ([grigio](https://github.com/grigio))
+
+- Fix git commit message encoding issue [\#85](https://github.com/mina-deploy/mina/pull/85) ([fuadsaud](https://github.com/fuadsaud))
+
+- Foreman's stop task should stop [\#84](https://github.com/mina-deploy/mina/pull/84) ([andrewhr](https://github.com/andrewhr))
+
+- Added '--create' to rvm:use and a new task to create rvm wrappers [\#81](https://github.com/mina-deploy/mina/pull/81) ([marcosbeirigo](https://github.com/marcosbeirigo))
+
+- Full path to tmp/restart.txt [\#77](https://github.com/mina-deploy/mina/pull/77) ([ineu](https://github.com/ineu))
+
+- Add :reenable option to Mina::Helper\#invoke [\#67](https://github.com/mina-deploy/mina/pull/67) ([uneco](https://github.com/uneco))
+
+- add echo to last command of :setup task [\#64](https://github.com/mina-deploy/mina/pull/64) ([muxcmux](https://github.com/muxcmux))
+
+## [v0.2.1](https://github.com/mina-deploy/mina/tree/v0.2.1) (2012-09-08)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.2.0...v0.2.1)
+
+**Closed issues:**
+
+- Deploying local repositories? [\#54](https://github.com/mina-deploy/mina/issues/54)
+
+- which -s doesn't work on Debain [\#44](https://github.com/mina-deploy/mina/issues/44)
+
+- Git password prompt does not work with "mina deploy" [\#41](https://github.com/mina-deploy/mina/issues/41)
+
+- \[Feature\] Agent Forwarding [\#23](https://github.com/mina-deploy/mina/issues/23)
+
+- warning: --depth is ignored in local clones; use file:// instead. [\#56](https://github.com/mina-deploy/mina/issues/56)
+
+**Merged pull requests:**
+
+- Fix check for arguments in make\_run\_task lambda [\#43](https://github.com/mina-deploy/mina/pull/43) ([tmak](https://github.com/tmak))
+
+## [v0.2.0](https://github.com/mina-deploy/mina/tree/v0.2.0) (2012-09-08)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.2.0.pre2...v0.2.0)
+
+**Closed issues:**
+
+- FATAL: Ident authentication failed for user "name" [\#52](https://github.com/mina-deploy/mina/issues/52)
+
+- Even faster asset compilation [\#32](https://github.com/mina-deploy/mina/issues/32)
+
+**Merged pull requests:**
+
+- fix ssh method when { :return =\> true } [\#53](https://github.com/mina-deploy/mina/pull/53) ([jpascal](https://github.com/jpascal))
+
+- Allow changing :term\_mode for setup task [\#51](https://github.com/mina-deploy/mina/pull/51) ([alfuken](https://github.com/alfuken))
+
+- Rewrote deploy:cleanup task to put it all in the same queue. [\#50](https://github.com/mina-deploy/mina/pull/50) ([dariocravero](https://github.com/dariocravero))
+
+- added support whenever and fix exit from console [\#47](https://github.com/mina-deploy/mina/pull/47) ([jpascal](https://github.com/jpascal))
+
+- Cleanup fails to cd releases\_path [\#45](https://github.com/mina-deploy/mina/pull/45) ([dariocravero](https://github.com/dariocravero))
+
+- Prevent git log from using a pager [\#42](https://github.com/mina-deploy/mina/pull/42) ([tmak](https://github.com/tmak))
+
+- Add helpful error message when there is a problem with deploy.rb or a custom Rakefile [\#37](https://github.com/mina-deploy/mina/pull/37) ([jesse-sge](https://github.com/jesse-sge))
+
+## [v0.2.0.pre2](https://github.com/mina-deploy/mina/tree/v0.2.0.pre2) (2012-08-02)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.1.3.pre1...v0.2.0.pre2)
+
+**Closed issues:**
+
+- Task Argument Error [\#36](https://github.com/mina-deploy/mina/issues/36)
+
+- Rename domain as host? [\#33](https://github.com/mina-deploy/mina/issues/33)
+
+- Skip database migrations [\#18](https://github.com/mina-deploy/mina/issues/18)
+
+- Optimize Git clone/checkout [\#10](https://github.com/mina-deploy/mina/issues/10)
+
+**Merged pull requests:**
+
+- Add in\_directory directory, to execute commands within a particular path [\#35](https://github.com/mina-deploy/mina/pull/35) ([jmibanez](https://github.com/jmibanez))
+
+- bundle\_path can't be nil [\#31](https://github.com/mina-deploy/mina/pull/31) ([sfate](https://github.com/sfate))
+
+## [v0.1.3.pre1](https://github.com/mina-deploy/mina/tree/v0.1.3.pre1) (2012-07-13)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.1.2...v0.1.3.pre1)
+
+**Closed issues:**
+
+- prompt for command-line input [\#30](https://github.com/mina-deploy/mina/issues/30)
+
+- Assets compiling on redeploy [\#25](https://github.com/mina-deploy/mina/issues/25)
+
+## [v0.1.2](https://github.com/mina-deploy/mina/tree/v0.1.2) (2012-07-06)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.1.2.pre2...v0.1.2)
+
+**Closed issues:**
+
+- deploy:link\_shared\_paths is broken [\#27](https://github.com/mina-deploy/mina/issues/27)
+
+## [v0.1.2.pre2](https://github.com/mina-deploy/mina/tree/v0.1.2.pre2) (2012-07-03)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.1.2.pre1...v0.1.2.pre2)
+
+**Closed issues:**
+
+- Ability to overwrite the default tasks [\#26](https://github.com/mina-deploy/mina/issues/26)
+
+- clean up old releases [\#24](https://github.com/mina-deploy/mina/issues/24)
+
+- Specifying an environment [\#21](https://github.com/mina-deploy/mina/issues/21)
+
+- Error when checking out to current\_revision [\#19](https://github.com/mina-deploy/mina/issues/19)
+
+- branching [\#13](https://github.com/mina-deploy/mina/issues/13)
+
+- Invoked tasks don't pick up ENV variables [\#11](https://github.com/mina-deploy/mina/issues/11)
+
+**Merged pull requests:**
+
+- Fix string interpolation in :init task output [\#15](https://github.com/mina-deploy/mina/pull/15) ([soulim](https://github.com/soulim))
+
+- Added support for an ssh port [\#14](https://github.com/mina-deploy/mina/pull/14) ([chip](https://github.com/chip))
+
+- link\_shared\_paths task was creating relative links instead of absolute ones [\#7](https://github.com/mina-deploy/mina/pull/7) ([Flink](https://github.com/Flink))
+
+- add bundle\_bin option [\#6](https://github.com/mina-deploy/mina/pull/6) ([Arcath](https://github.com/Arcath))
+
+## [v0.1.2.pre1](https://github.com/mina-deploy/mina/tree/v0.1.2.pre1) (2012-06-11)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/show...v0.1.2.pre1)
+
+## [show](https://github.com/mina-deploy/mina/tree/show) (2012-06-11)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.1.1...show)
+
+**Closed issues:**
+
+- Run deploy outside of app directory [\#3](https://github.com/mina-deploy/mina/issues/3)
+
+## [v0.1.1](https://github.com/mina-deploy/mina/tree/v0.1.1) (2012-06-07)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.1.0...v0.1.1)
+
+**Merged pull requests:**
+
+- Test git [\#2](https://github.com/mina-deploy/mina/pull/2) ([sosedoff](https://github.com/sosedoff))
+
+## [v0.1.0](https://github.com/mina-deploy/mina/tree/v0.1.0) (2012-06-06)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.0.1.pre7...v0.1.0)
+
+## [v0.0.1.pre7](https://github.com/mina-deploy/mina/tree/v0.0.1.pre7) (2012-06-06)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.0.1.pre6...v0.0.1.pre7)
+
+## [v0.0.1.pre6](https://github.com/mina-deploy/mina/tree/v0.0.1.pre6) (2012-06-06)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.0.1.pre5...v0.0.1.pre6)
+
+**Merged pull requests:**
+
+- Gem tasks [\#1](https://github.com/mina-deploy/mina/pull/1) ([sosedoff](https://github.com/sosedoff))
+
+## [v0.0.1.pre5](https://github.com/mina-deploy/mina/tree/v0.0.1.pre5) (2012-06-04)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.0.1.pre4...v0.0.1.pre5)
+
+## [v0.0.1.pre4](https://github.com/mina-deploy/mina/tree/v0.0.1.pre4) (2012-06-04)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.0.1.pre3...v0.0.1.pre4)
+
+## [v0.0.1.pre3](https://github.com/mina-deploy/mina/tree/v0.0.1.pre3) (2012-06-03)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/release/2012-06-03-180648...v0.0.1.pre3)
+
+## [release/2012-06-03-180648](https://github.com/mina-deploy/mina/tree/release/2012-06-03-180648) (2012-06-03)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/release/2012-06-03-180617...release/2012-06-03-180648)
+
+## [release/2012-06-03-180617](https://github.com/mina-deploy/mina/tree/release/2012-06-03-180617) (2012-06-03)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.0.1.pre2...release/2012-06-03-180617)
+
+## [v0.0.1.pre2](https://github.com/mina-deploy/mina/tree/v0.0.1.pre2) (2012-06-02)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/v0.0.1.pre1...v0.0.1.pre2)
+
+## [v0.0.1.pre1](https://github.com/mina-deploy/mina/tree/v0.0.1.pre1) (2012-06-02)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/release/2012-06-02--00-06-53...v0.0.1.pre1)
+
+## [release/2012-06-02--00-06-53](https://github.com/mina-deploy/mina/tree/release/2012-06-02--00-06-53) (2012-06-01)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/release/2012-06-01--21-06-08...release/2012-06-02--00-06-53)
+
+## [release/2012-06-01--21-06-08](https://github.com/mina-deploy/mina/tree/release/2012-06-01--21-06-08) (2012-06-01)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/release/2012-06-01--21-06-49...release/2012-06-01--21-06-08)
+
+## [release/2012-06-01--21-06-49](https://github.com/mina-deploy/mina/tree/release/2012-06-01--21-06-49) (2012-06-01)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/release/2012-06-01--21-06-10...release/2012-06-01--21-06-49)
+
+## [release/2012-06-01--21-06-10](https://github.com/mina-deploy/mina/tree/release/2012-06-01--21-06-10) (2012-06-01)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/release/2012-06-01--21-06-45...release/2012-06-01--21-06-10)
+
+## [release/2012-06-01--21-06-45](https://github.com/mina-deploy/mina/tree/release/2012-06-01--21-06-45) (2012-06-01)
+
+[Full Changelog](https://github.com/mina-deploy/mina/compare/release/2012-06-01--21-06-01...release/2012-06-01--21-06-45)
+
+## [release/2012-06-01--21-06-01](https://github.com/mina-deploy/mina/tree/release/2012-06-01--21-06-01) (2012-06-01)
+
+
+
+\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\ No newline at end of file
diff --git a/HISTORY.md b/HISTORY.md
index ed3f1be..ce56892 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,4 +1,50 @@
-## v0.3.2 - unreleased
+Latest version - Mar 27, 2015
+-----------------------------
+
+### Fixed:
+ * invoke does not work after a to block (#285)
+
+### Added:
+ * before and after hooks
+
+
+Latest version - Mar 10, 2015
+-----------------------------
+
+### Fixed:
+ * link typo in readme (#273) [Henare Degan]
+ * up formatting of code block in readme (#274) [Henare Degan]
+ * Rolling back to previous release (#9) [Tyler Mandry]
+ * ruby 1.8.7 and rake 0.9 issue with invoke
+
+### Changed:
+ * update 3rd party list
+ * update docs, added db_rollback rails command
+
+[Tyler Mandry]: https://github.com/tmandry
+[Henare Degan]: https://github.com/henare
+
+
+v0.3.2 - January 24, 2015
+-----------------------------
+
+* 3rd party modules (#258) [Denis]
+* Adding support for environment variables, env_var (#161) [Ted Price]
+* Make rails console task dependent on the environment (#220) [lucapette]
+* mention .ruby-version for rbenv comment (#249) [Tomi]
+* update emails for travis
+* npm support with a simple npm:install task (#227) [Paul B.]
+* `mina ssh` command to connect to server (#249) [Anton Dieterle]
+* link in the support guide (#254) [Aaditya S]
+
+[Denis]: https://github.com/stereodenis
+[Aaditya S]: https://github.com/jartek
+[Tomi]: https://github.com/equivalent
+[lucapette]: https://github.com/lucapette
+[Ted Price]: https://github.com/pricees
+[Anton Dieterle]: https://github.com/adie
+[Paul B.]: https://github.com/paulRbr
+
v0.3.1 - October 17, 2014
-------------------------
diff --git a/Makefile b/Makefile
index 50ea6c6..89656ff 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ Readme.md: \
support/guide.md \
support/helpers.md \
support/modules.md \
+ support/third_party_modules.md \
support/Readme-footer.md
cat $^ > $@
@@ -15,6 +16,8 @@ support/modules.md: \
lib/mina/rails.rb \
lib/mina/rbenv.rb \
lib/mina/rvm.rb \
+ lib/mina/npm.rb \
+ lib/mina/tools.rb \
lib/mina/whenever.rb
cat $^ | ruby support/to_md.rb > $@
diff --git a/Readme.md b/Readme.md
index 37bc6b3..55609a5 100644
--- a/Readme.md
+++ b/Readme.md
@@ -13,7 +13,7 @@ session per deploy, minimizing the SSH connection overhead.
$ gem install mina
$ mina
-[](https://travis-ci.org/mina-deploy/mina) [](http://badge.fury.io/rb/mina)
+[](https://travis-ci.org/mina-deploy/mina) [](http://badge.fury.io/rb/mina) [](http://inch-ci.org/github/mina-deploy/mina)
User guide
==========
@@ -62,7 +62,7 @@ via SSH and create the right directories.
$ mina setup
-----> Creating folders... done.
-See [directory structure](#directory-structure) for more info.
+See [directory structure](#directory_structure) for more info.
### Step 4: Deploy!
@@ -199,8 +199,7 @@ task :deploy do
# These are instructions to start the app after it's been prepared.
to :launch do
- queue "mkdir -p #{deploy_to}/#{current_path}/tmp/"
- queue "touch #{deploy_to}/#{current_path}/tmp/restart.txt"
+ queue 'touch tmp/restart.txt'
end
# This optional block defines how a broken release should be cleaned up.
@@ -300,7 +299,7 @@ Basic usage:
### Tasks
-There are many tasks available. See the [tasks reference](http://mina-deploy.github.io/mina/tasks/index.html), or
+There are many tasks available. See the [tasks reference](http://mina-deploy.github.io/mina/tasks/), or
type `mina tasks`.
### Variables
@@ -316,7 +315,8 @@ You can add as many variables as needed.
# Helpers
### invoke
-Invokes another Rake task. By default if the task has already been invoked it will not been executed again (see the `:reenable` option).
+Invokes another Rake task.
+By default if the task has already been invoked it will not been executed again (see the `:reenable` option).
Invokes the task given in `task`. Returns nothing.
@@ -325,8 +325,10 @@ invoke :'git:clone'
invoke :restart
~~~
-__Options:__
- `:reenable` (bool) - Execute the task even next time. Defaults to `false`
+Options:
+ reenable (bool) - Execute the task even next time.
+
+task.to_s is a ruby 1.8.7 fix
### erb
Evaluates an ERB block in the current scope and returns a string.
@@ -354,6 +356,22 @@ run!
Returns nothing.
+### run_local!
+runs the code locally that has been queued.
+Has to be in :before_hook or :after_hook queue
+
+This is already automatically invoked before Rake exits to run all
+commands that have been queued up.
+
+~~~ ruby
+to :before_hook do
+ queue "cp file1 file2"
+end
+run_local!(:before_hook)
+~~~
+
+Returns nothing.
+
### report_time
Report time elapsed in the block.
Returns the output of the block.
@@ -613,6 +631,9 @@ Sets the path to where the gems are expected to be.
This path will be symlinked to `./shared/bundle` so that the gems cache will
be shared between all releases.
+### bundle_withouts
+Sets the colon-separated list of groups to be skipped from installation.
+
### bundle_options
Sets the options for installing gems via Bundler.
@@ -648,6 +669,9 @@ The local path to the SSH private key file.
### ssh_options
Switches to be passed to the `ssh` command.
+### env_vars
+Environment variables to be passed to `ssh` command. (e.g. "foo=bar baz=1")
+
## Tasks
Any and all of these settings can be overriden in your `deploy.rb`.
@@ -672,6 +696,13 @@ Display all tasks in a nice table.
$ mina tasks
~~~
+### ssh
+Connects to the server via ssh and cd to deploy_to folder
+
+~~~ ruby
+$ mina ssh
+~~~
+
# Modules: Deployment
This module is automatically loaded for all Mina projects.
@@ -720,6 +751,20 @@ By default, the last 5 releases are kept on each server (though you can
change this with the keep_releases setting). All other deployed revisions
are removed from the servers."
+### deploy:rollback
+Rollbacks the latest release.
+
+Changes the current link to previous release, and deletes the newest deploy release
+Does NOT rollback the database, use
+
+~~~ ruby
+mina "rake[db:rollback]"
+~~~
+
+Delete existing sym link and create a new symlink pointing to the previous release
+
+Remove latest release folder (current release)
+
### setup
Sets up a site's directory structure.
@@ -727,7 +772,7 @@ Sets up a site's directory structure.
Runs a command on a server.
~~~ ruby
-$ mina run[tail -f logs.txt]
+$ mina "run[tail -f logs.txt]"
~~~
# Modules: Foreman
@@ -792,6 +837,9 @@ their own.
### git:clone
Clones the Git repository. Meant to be used inside a deploy script.
+### git:revision
+Gets the current git revision deployed on server.
+
# Modules: Rails
Adds settings and tasks for managing Rails projects.
@@ -842,6 +890,14 @@ release.
Override this if you have custom asset paths declared in your Rails's
`config.assets.paths` setting.
+### compiled_asset_path
+The path to be copied to the new release.
+
+The path your assets are compiled to. If your `assets_path` assets have changed,
+this is the folder that gets copied accross from the current release to the new release.
+
+Override this if you have custom public asset paths.
+
### rake_assets_precompile
The command to invoke when precompiling assets.
Override me if you like.
@@ -857,14 +913,14 @@ These tasks can be invoked in the command line.
Invokes a rails command.
~~~ ruby
-$ mina rails[console]
+$ mina "rails[console]"
~~~
### rake[]
Invokes a rake command.
~~~ ruby
-$ mina rake db:cleanup
+$ mina "rake[db:migrate]"
~~~
### console
@@ -874,6 +930,13 @@ Opens the Ruby console for the currently-deployed version.
$ mina console
~~~
+### log
+Tail log from server
+
+~~~ ruby
+$ mina log
+~~~
+
## Deploy tasks
These tasks are meant to be invoked inside deploy scripts, not invoked on
their own.
@@ -882,6 +945,10 @@ their own.
### rails:db_migrate:force
+### rails:db_create
+
+### rails:db_rollback
+
### rails:assets_precompile:force
### rails:assets_precompile
@@ -973,14 +1040,94 @@ task ::setup => :environment do
end
~~~
+Adds settings and tasks for managing Node packages.
+
+~~~ ruby
+require 'mina/npm'
+~~~
+
+## Settings
+Any and all of these settings can be overriden in your `deploy.rb`.
+
+### npm_bin
+Sets the npm binary.
+
+### bower_bin
+Sets the bower binary.
+
+### grunt_bin
+Sets the grunt binary.
+
+### npm_options
+Sets the options for installing modules via npm.
+
+### bower_options
+Sets the options for installing modules via bower.
+
+### grunt_options
+Sets the options for grunt.
+
+### grunt_task
+Sets the task parameters for grunt.
+
+## Deploy tasks
+These tasks are meant to be invoked inside deploy scripts, not invoked on
+their own.
+
+### npm:install
+Installs node modules. Takes into account if executed `in_directory` and namespaces the installed modules in the shared folder.
+
+### bower:install
+Installs bower modules. Takes into account if executed `in_directory` and namespaces the installed modules in the shared folder.
+
+### grunt:install
+Launch a task with grunt. Set the grunt_task (defaults to \"build\") variable before calling this.
+
+# Modules: Whenever
Adds settings and tasks for managing projects with [whenever].
+
[whenever]: http://rubygems.org/gems/whenever
+## Common usage
+~~~ ruby
+require 'mina/whenever'
+task :deploy => :environment do
+ deploy do
+ ...
+ to :launch do
+ invoke :'whenever:update'
+ end
+end
+~~~
+
+3rd party modules
+------
+
+* [mina-rollbar](https://github.com/code-lever/mina-rollbar)
+* [mina-stack](https://github.com/div/mina-stack)
+* [mina-rsync](https://github.com/moll/mina-rsync)
+* [mina-sidekiq](https://github.com/Mic92/mina-sidekiq)
+* [mina-delayed_job](https://github.com/d4be4st/mina-delayed_job)
+* [mina-nginx](https://github.com/hbin/mina-nginx)
+* [mina-newrelic](https://github.com/navinpeiris/mina-newrelic)
+* [mina-rbenv-addons](https://github.com/stas/mina-rbenv-addons)
+* [mina-multistage](https://github.com/endoze/mina-multistage)
+* [mina-s3](https://github.com/stas/mina-s3)
+* [mina-scp](https://github.com/adie/mina-scp)
+* [mina-hooks](https://github.com/elskwid/mina-hooks)
+* [mina-slack](https://github.com/TAKAyukiatkwsk/mina-slack)
+* [mina-cakephp](https://github.com/mobvox/mina-cakephp)
+* [mina-unicorn](https://github.com/openteam/mina-unicorn)
+* [mina-puma](https://github.com/sandelius/mina-puma)
+* [mina-mercurial](https://github.com/rainlabs/mina-mercurial)
+* [mina-faye](https://github.com/NingenUA/mina-faye)
+* [mina-clockwork](https://github.com/907th/mina-clockwork)
+* [mina-ftp](https://github.com/stas/mina-ftp)
+
Acknowledgements
----------------
-© 2012-2014, Nadarei. Released under the [MIT
-License](http://www.opensource.org/licenses/mit-license.php).
+© 2012-2015, Nadarei. Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
Mina is authored and maintained by [Rico Sta. Cruz][rsc] and [Michael
Galero][mg] with help from its [contributors][c]. It is sponsored by our
@@ -1002,7 +1149,7 @@ Michael:
[rsc]: http://ricostacruz.com
[mg]: http://devblog.michaelgalero.com/
-[c]: https://github.com/mina-deploy/mina/graphs/contributors
+[c]: http://github.com/mina-deploy/mina/graphs/contributors
[nd]: http://nadarei.co
[issues]: https://github.com/mina-deploy/mina/issues
[trello]: https://trello.com/board/mina/4fc8b3023d9c9a4d72e573e6
diff --git a/data/deploy.rb b/data/deploy.rb
index 56c2d57..a30a388 100644
--- a/data/deploy.rb
+++ b/data/deploy.rb
@@ -20,7 +20,7 @@ set :branch, 'master'
# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
# They will be linked in the 'deploy:link_shared_paths' step.
-set :shared_paths, ['config/database.yml', 'log']
+set :shared_paths, ['config/database.yml', 'config/secrets.yml', 'log']
# Optional settings:
# set :user, 'foobar' # Username in the server to SSH to.
@@ -31,7 +31,7 @@ set :shared_paths, ['config/database.yml', 'log']
# `mina deploy` or `mina rake`.
task :environment do
# If you're using rbenv, use this to load the rbenv environment.
- # Be sure to commit your .rbenv-version to your repository.
+ # Be sure to commit your .ruby-version or .rbenv-version to your repository.
# invoke :'rbenv:load'
# For those using RVM, use this to load an RVM version at gemset.
@@ -49,11 +49,22 @@ task :setup => :environment do
queue! %[chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/config"]
queue! %[touch "#{deploy_to}/#{shared_path}/config/database.yml"]
- queue %[echo "-----> Be sure to edit '#{deploy_to}/#{shared_path}/config/database.yml'."]
+ queue! %[touch "#{deploy_to}/#{shared_path}/config/secrets.yml"]
+ queue %[echo "-----> Be sure to edit '#{deploy_to}/#{shared_path}/config/database.yml' and 'secrets.yml'."]
+
+ queue %[
+ repo_host=`echo $repo | sed -e 's/.*@//g' -e 's/:.*//g'` &&
+ repo_port=`echo $repo | grep -o ':[0-9]*' | sed -e 's/://g'` &&
+ if [ -z "${repo_port}" ]; then repo_port=22; fi &&
+ ssh-keyscan -p $repo_port -H $repo_host >> ~/.ssh/known_hosts
+ ]
end
desc "Deploys the current version to the server."
task :deploy => :environment do
+ to :before_hook do
+ # Put things to run locally before ssh
+ end
deploy do
# Put things that will set up an empty directory into a fully set-up
# instance of your project.
@@ -77,4 +88,3 @@ end
# - http://nadarei.co/mina/tasks
# - http://nadarei.co/mina/settings
# - http://nadarei.co/mina/helpers
-
diff --git a/data/deploy.sh.erb b/data/deploy.sh.erb
index 172b592..8c104b7 100644
--- a/data/deploy.sh.erb
+++ b/data/deploy.sh.erb
@@ -1,5 +1,6 @@
<%
prepare = commands(:default).map { |s| "(\n\n#{indent 2, s}\n\n)" }.join(" && ")
+ build = commands(:build).map { |s| "(\n\n#{indent 2, s}\n\n)" }.join(" && ")
launch = commands(:launch).map { |s| "(\n\n#{indent 2, s}\n\n)" }.join(" && ")
clean = commands(:clean).map { |s| "(\n\n#{indent 2, s}\n\n)" }.join(" && ")
%>
@@ -25,7 +26,7 @@ fi
if [ -e "<%= lock_file %>" ]; then
echo "! ERROR: another deployment is ongoing."
echo "The file '<%= lock_file %>' was found."
- echo "If no other deployment is ongoing, delete the file to continue."
+ echo "If no other deployment is ongoing, run 'mina deploy:force_unlock' to delete the file."
exit 17
fi
@@ -49,16 +50,29 @@ fi
<%= echo_cmd %[cd "$build_path"] %> &&
(
<%= indent 4, (prepare.empty? ? "true" : prepare) %>
- )
+ ) &&
+ echo "-----> Deploy finished"
) &&
#
-# Rename to the real release path, then symlink 'current'
+# Build
(
- echo "-----> Build finished"
+ echo "-----> Building"
echo "-----> Moving build to $release_path"
<%= echo_cmd %[mv "$build_path" "$release_path"] %> &&
+ <%= echo_cmd %[cd "$release_path"] %> &&
+ (
+<%= indent 4, (build.empty? ? "true" : build) %>
+ ) &&
+ echo "-----> Build finished"
+) &&
+
+#
+# Launching
+# Rename to the real release path, then symlink 'current'
+(
+ echo "-----> Launching"
echo "-----> Updating the <%= current_path %> symlink" &&
<%= echo_cmd %[ln -nfs "$release_path" "#{current_path}"] %>
) &&
diff --git a/lib/mina.rb b/lib/mina.rb
index 3428ea8..88bc4b9 100644
--- a/lib/mina.rb
+++ b/lib/mina.rb
@@ -7,6 +7,7 @@ module Mina
autoload :DeployHelpers, 'mina/deploy_helpers'
autoload :OutputHelpers, 'mina/output_helpers'
autoload :SshHelpers, 'mina/ssh_helpers'
+ autoload :LocalHelpers, 'mina/local_helpers'
autoload :ExecHelpers, 'mina/exec_helpers'
autoload :Helpers, 'mina/helpers'
autoload :Settings, 'mina/settings'
diff --git a/lib/mina/default.rb b/lib/mina/default.rb
index d3de035..4820352 100644
--- a/lib/mina/default.rb
+++ b/lib/mina/default.rb
@@ -23,6 +23,9 @@
# ### ssh_options
# Switches to be passed to the `ssh` command.
+# ### env_vars
+# Environment variables to be passed to `ssh` command. (e.g. "foo=bar baz=1")
+
# ## Tasks
# Any and all of these settings can be overriden in your `deploy.rb`.
@@ -143,3 +146,13 @@ desc "Show all tasks."
task :tasks do
show_task_help :full => true
end
+
+# ### ssh
+# Connects to the server via ssh and cd to deploy_to folder
+#
+# $ mina ssh
+
+desc "Open an ssh session to the server and cd to deploy_to folder"
+task :ssh do
+ exec ssh_command + " 'cd #{deploy_to} && exec \$SHELL'"
+end
diff --git a/lib/mina/deploy.rb b/lib/mina/deploy.rb
index 1ff8780..c5b5470 100644
--- a/lib/mina/deploy.rb
+++ b/lib/mina/deploy.rb
@@ -85,6 +85,28 @@ namespace :deploy do
#{echo_cmd %{ls -1d [0-9]* | sort -rn | tail -n $remove | xargs rm -rf {}}}
}
end
+
+ # ### deploy:rollback
+ # Rollbacks the latest release.
+ #
+ # Changes the current link to previous release, and deletes the newest deploy release
+ # Does NOT rollback the database, use
+ #
+ # mina "rake[db:rollback]"
+ desc "Rollbacks the latest release"
+ task :rollback => :environment do
+ queue %[echo "-----> Rolling back to previous release for instance: #{domain}"]
+
+ # Delete existing sym link and create a new symlink pointing to the previous release
+ queue %[echo -n "-----> Creating new symlink from the previous release: "]
+ queue %[ls -Art "#{deploy_to}/releases" | sort | tail -n 2 | head -n 1]
+ queue! %[ls -Art "#{deploy_to}/releases" | sort | tail -n 2 | head -n 1 | xargs -I active ln -nfs "#{deploy_to}/releases/active" "#{deploy_to}/current"]
+
+ # Remove latest release folder (current release)
+ queue %[echo -n "-----> Deleting current release: "]
+ queue %[ls -Art "#{deploy_to}/releases" | sort | tail -n 1]
+ queue! %[ls -Art "#{deploy_to}/releases" | sort | tail -n 1 | xargs -I active rm -rf "#{deploy_to}/releases/active"]
+ end
end
# ### setup
@@ -124,7 +146,7 @@ end
# ### run[]
# Runs a command on a server.
#
-# $ mina run[tail -f logs.txt]
+# $ mina "run[tail -f logs.txt]"
desc "Runs a command in the server."
task :run, [:command] => [:environment] do |t, args|
diff --git a/lib/mina/foreman.rb b/lib/mina/foreman.rb
index 43f848c..698cf7d 100644
--- a/lib/mina/foreman.rb
+++ b/lib/mina/foreman.rb
@@ -43,12 +43,13 @@ set_default :foreman_log, lambda { "#{deploy_to!}/#{shared_path}/log" }
set_default :foreman_sudo, true
set_default :foreman_format, 'upstart'
set_default :foreman_location, '/etc/init'
+set_default :foreman_procfile, 'Procfile'
namespace :foreman do
desc 'Export the Procfile to Ubuntu upstart scripts'
task :export do
sudo_cmd = "sudo" if foreman_sudo
- export_cmd = "#{sudo_cmd} bundle exec foreman export #{foreman_format} #{foreman_location} -a #{foreman_app} -u #{foreman_user} -d #{deploy_to!}/#{current_path!} -l #{foreman_log}"
+ export_cmd = "#{sudo_cmd} bundle exec foreman export #{foreman_format} #{foreman_location} -a #{foreman_app} -u #{foreman_user} -d #{deploy_to!}/#{current_path!} -l #{foreman_log} -f #{foreman_procfile}"
queue %{
echo "-----> Exporting foreman procfile for #{foreman_app}"
diff --git a/lib/mina/git.rb b/lib/mina/git.rb
index cc9ce74..9ace051 100644
--- a/lib/mina/git.rb
+++ b/lib/mina/git.rb
@@ -52,6 +52,7 @@ namespace :git do
status = %[
echo "-----> Using this git commit" &&
echo &&
+ #{echo_cmd %[git rev-parse HEAD > .mina_git_revision]} &&
#{echo_cmd %[git --no-pager log --format='%aN (%h):%n> %s' -n 1]} &&
#{echo_cmd %[rm -rf .git]} &&
echo
@@ -59,4 +60,10 @@ namespace :git do
queue clone + status
end
+
+ # ### git:revision
+ # Gets the current git revision deployed on server.
+ task :revision do
+ queue %[cat #{deploy_to}/current/.mina_git_revision]
+ end
end
diff --git a/lib/mina/helpers.rb b/lib/mina/helpers.rb
index 05e356f..33c707f 100644
--- a/lib/mina/helpers.rb
+++ b/lib/mina/helpers.rb
@@ -5,6 +5,7 @@ module Mina
# ### invoke
# Invokes another Rake task.
+ # By default if the task has already been invoked it will not been executed again (see the `:reenable` option).
#
# Invokes the task given in `task`. Returns nothing.
#
@@ -16,6 +17,8 @@ module Mina
#
def invoke(task, options = {})
+ # task.to_s is a ruby 1.8.7 fix
+ task = task.to_s
Rake.application.invoke_task task
if options[:reenable]
name = Rake.application.parse_task_string(task).first
@@ -57,6 +60,23 @@ module Mina
report_time { ssh commands(:default) }
end
+ # ### run_local!
+ # runs the code locally that has been queued.
+ # Has to be in :before_hook or :after_hook queue
+ #
+ # This is already automatically invoked before Rake exits to run all
+ # commands that have been queued up.
+ #
+ # to :before_hook do
+ # queue "cp file1 file2"
+ # end
+ # run_local!(:before_hook)
+ #
+ # Returns nothing.
+ def run_local!(aspect)
+ report_time { local commands(aspect) }
+ end
+
# ### report_time
# Report time elapsed in the block.
# Returns the output of the block.
@@ -91,7 +111,9 @@ module Mina
# Returns nothing.
def mina_cleanup!
+ run_local!(:before_hook) if commands(:before_hook).any?
run! if commands.any?
+ run_local!(:after_hook) if commands(:after_hook).any?
end
# ## Errors
@@ -103,7 +125,7 @@ module Mina
# die 2
# die 2, "Tests failed"
- def die(code=1, msg=null)
+ def die(msg=nil, code=1)
str = "Failed with status #{code}"
str += " (#{msg})" if msg
err = Failed.new(str)
@@ -136,6 +158,7 @@ module Mina
def queue(code)
commands
+ @to ||= :default
commands(@to) << unindent(code)
end
@@ -185,9 +208,8 @@ module Mina
# commands == ["sudo restart", "true"]
# commands(:clean) == ["rm"]
- def commands(aspect=:default)
+ def commands(aspect = :default)
(@commands ||= begin
- @to = :default
Hash.new { |h, k| h[k] = Array.new }
end)[aspect]
end
diff --git a/lib/mina/ssh_helpers.rb b/lib/mina/local_helpers.rb
similarity index 50%
copy from lib/mina/ssh_helpers.rb
copy to lib/mina/local_helpers.rb
index 8b059a0..54d46c0 100644
--- a/lib/mina/ssh_helpers.rb
+++ b/lib/mina/local_helpers.rb
@@ -1,14 +1,13 @@
-# # Helpers: SSH helpers
+# # Helpers: Local helpers
# You don't need to invoke these helpers, they're already invoked automatically.
module Mina
- module SshHelpers
-
- # ### ssh
- # Executes a command via SSH.
+ module LocalHelpers
+ # ### local
+ # Executes a command.
#
# Returns nothing usually, but if `{ return: true }` is given, returns the
- # STDOUT output of the SSH session.
+ # STDOUT output.
#
# `options` is a hash of options:
#
@@ -17,58 +16,32 @@ module Mina
#
# Example
#
- # ssh("ls", return: true)
-
- def ssh(cmd, options={})
- require 'shellwords'
+ # local("ls", return: true)
- cmd = cmd.join("\n") if cmd.is_a?(Array)
- script = Shellwords.escape(cmd)
+ def local(cmd, options = {})
+ script = cmd.join("\n") if cmd.is_a?(Array)
if options[:return] == true
- `#{ssh_command} -- #{script}`
-
+ `#{script}`
elsif simulate_mode?
- Ssh.simulate(cmd, ssh_command)
-
+ Local.simulate(script)
else
- result = Ssh.invoke(script, self)
- Ssh.ensure_successful result, self
+ result = Local.invoke(script, self)
+ Local.ensure_successful result, self
end
end
- # ### ssh_command
- # Returns the SSH command to be executed.
- #
- # set :domain, 'foo.com'
- # set :user, 'diggity'
- #
- # puts ssh_command
- # #=> 'ssh diggity at foo.com'
-
- def ssh_command
- args = domain!.dup
- args = "#{user}@#{args}" if user?
- args << " -i #{identity_file}" if identity_file?
- args << " -p #{port}" if port?
- args << " -A" if forward_agent?
- args << " #{ssh_options}" if ssh_options?
- args << " -t"
- "ssh #{args}"
- end
-
# ## Private methods
- # `ssh` delegates to these.
-
- module Ssh
+ # `local` delegates to these.
+ module Local
extend self
- # ### Ssh.simulate
- # __Internal:__ Prints SSH command. Called by `ssh`.
+ # ### Local.simulate
+ # __Internal:__ Prints command.
- def simulate(cmd, ssh_command)
- str = "Executing the following via '#{ssh_command}':"
+ def simulate(cmd)
+ str = "Executing the following:"
puts "#!/usr/bin/env bash"
puts "# #{str}"
puts "#"
@@ -78,29 +51,32 @@ module Mina
0
end
- # ### Ssh.invoke
+ # ### Local.invoke
# __Internal:__ Initiates an SSH session with script `script` with given
- # `term_mode`. Called by `ssh`.
+ # `term_mode`. Called by `local`.
def invoke(script, this)
# Ruby 1.8.7 doesn't let you have empty symbols
term_mode = :"#{this.settings.term_mode}" if this.settings.term_mode
- code = "#{this.ssh_command} -- #{script}"
+ code = "#{script}"
# Certain environments can't do :pretty mode.
- term_mode = :exec if term_mode == :pretty && !pretty_supported?
+ term_mode = :exec if term_mode == :pretty && !pretty_supported?
case term_mode
when :pretty
+ require 'shellwords'
+ code = Shellwords.escape(code)
this.pretty_system(code)
when :exec
- exec code
+ Kernel.exec code
else
- system code
- $?.to_i
+ Kernel.system code
+ $?.exitstatus
end
end
+ # TODO: Move to concern
def pretty_supported?
# open4 is not supported under Windows.
# https://github.com/nadarei/mina/issues/58
@@ -108,7 +84,7 @@ module Mina
! (RbConfig::CONFIG['host_os'] =~ /mswin|mingw/)
end
- # ### Ssh.ensure_successful
+ # ### Local.ensure_successful
# __Internal:__ Halts the execution if the given result code is not
# successful (non-zero).
@@ -116,8 +92,6 @@ module Mina
this.die result if result.is_a?(Fixnum) && result > 0
result
end
-
end
-
end
end
diff --git a/lib/mina/npm.rb b/lib/mina/npm.rb
new file mode 100644
index 0000000..dad36ea
--- /dev/null
+++ b/lib/mina/npm.rb
@@ -0,0 +1,89 @@
+# # Modules: Npm
+# Adds settings and tasks for managing Node packages.
+#
+# require 'mina/npm'
+
+# ## Settings
+# Any and all of these settings can be overriden in your `deploy.rb`.
+
+# ### npm_bin
+# Sets the npm binary.
+
+set_default :npm_bin, 'npm'
+
+# ### bower_bin
+# Sets the bower binary.
+
+set_default :bower_bin, 'bower'
+
+# ### grunt_bin
+# Sets the grunt binary.
+
+set_default :grunt_bin, 'grunt'
+
+# ### npm_options
+# Sets the options for installing modules via npm.
+
+set_default :npm_options, '--production'
+
+# ### bower_options
+# Sets the options for installing modules via bower.
+
+set_default :bower_options, '--allow-root'
+
+# ### grunt_options
+# Sets the options for grunt.
+
+set_default :grunt_options, ''
+
+# ### grunt_task
+# Sets the task parameters for grunt.
+
+set_default :grunt_task, 'build'
+
+
+# ## Deploy tasks
+# These tasks are meant to be invoked inside deploy scripts, not invoked on
+# their own.
+
+namespace :npm do
+ # ### npm:install
+ # Installs node modules. Takes into account if executed `in_directory` and namespaces the installed modules in the shared folder.
+ desc "Install node modules using Npm."
+ task :install => :environment do
+ queue %{
+ echo "-----> Installing node modules using Npm"
+ sub_directory=$(pwd | sed -r "s/.*?$(basename $build_path)//g")
+ #{echo_cmd %[mkdir -p "#{deploy_to}/#{shared_path}/$sub_directory/node_modules"]}
+ #{echo_cmd %[ln -s "#{deploy_to}/#{shared_path}/$sub_directory/node_modules" "node_modules"]}
+ #{echo_cmd %[#{npm_bin} install #{npm_options}]}
+ }
+ end
+end
+
+namespace :bower do
+ # ### bower:install
+ # Installs bower modules. Takes into account if executed `in_directory` and namespaces the installed modules in the shared folder.
+ desc "Install bower modules."
+ task :install => :environment do
+ queue %{
+ echo "-----> Installing bower modules"
+ sub_directory=$(pwd | sed -r "s/.*?$(basename $build_path)//g")
+ #{echo_cmd %[mkdir -p "#{deploy_to}/#{shared_path}/$sub_directory/bower_components"]}
+ #{echo_cmd %[ln -s "#{deploy_to}/#{shared_path}/$sub_directory/bower_components" "bower_components"]}
+ #{echo_cmd %[[ -f bower.json ] && (#{bower_bin} install #{bower_options}) || ! [ -f bower.json ]]}
+ }
+ end
+end
+
+namespace :grunt do
+ # ### grunt:install
+ # Launch a task with grunt. Set the grunt_task (defaults to \"build\") variable before calling this.
+ desc "Launch a task with grunt. Set the grunt_task (defaults to \"build\") variable before calling this."
+ task :task => :environment do
+ queue %{
+ echo "-----> Launch a build with Grunt"
+ #{echo_cmd %[[ -f Gruntfile.js ] && (#{grunt_bin} #{grunt_task} #{grunt_options}) || ! [ -f Gruntfile.js ]]}
+ }
+ end
+end
diff --git a/lib/mina/rails.rb b/lib/mina/rails.rb
index b361b78..f7e5b6e 100644
--- a/lib/mina/rails.rb
+++ b/lib/mina/rails.rb
@@ -52,6 +52,16 @@ set_default :rails, lambda { %{#{bundle_prefix} rails} }
set_default :asset_paths, ['vendor/assets/', 'app/assets/']
+# ### compiled_asset_path
+# The path to be copied to the new release.
+#
+# The path your assets are compiled to. If your `assets_path` assets have changed,
+# this is the folder that gets copied accross from the current release to the new release.
+#
+# Override this if you have custom public asset paths.
+
+set_default :compiled_asset_path, 'public/assets'
+
# ### rake_assets_precompile
# The command to invoke when precompiling assets.
# Override me if you like.
@@ -75,7 +85,7 @@ make_run_task = lambda { |name, sample_args|
def check_for_changes_script(options={})
diffs = options[:at].map { |path|
- %[diff -r "#{deploy_to}/#{current_path}/#{path}" "./#{path}" 2>/dev/null]
+ %[diff -rN "#{deploy_to}/#{current_path}/#{path}" "./#{path}" 2>/dev/null]
}.join("\n")
unindent %[
@@ -102,7 +112,7 @@ end
# ### rails[]
# Invokes a rails command.
#
-# $ mina rails[console]
+# $ mina "rails[console]"
desc "Execute a Rails command in the current deploy."
make_run_task[:rails, 'console']
@@ -110,7 +120,7 @@ make_run_task[:rails, 'console']
# ### rake[]
# Invokes a rake command.
#
-# $ mina rake db:cleanup
+# $ mina "rake[db:migrate]"
desc "Execute a Rake command in the current deploy."
make_run_task[:rake, 'db:migrate']
@@ -121,10 +131,20 @@ make_run_task[:rake, 'db:migrate']
# $ mina console
desc "Starts an interactive console."
-task :console do
+task :console => :environment do
queue echo_cmd %[cd "#{deploy_to!}/#{current_path!}" && #{rails} console && exit]
end
+# ### log
+# Tail log from server
+#
+# $ mina log
+
+desc "Tail log from server"
+task :log => :environment do
+ queue %[tail -f #{deploy_to}/#{current_path}/log/#{rails_env}.log]
+end
+
# ## Deploy tasks
# These tasks are meant to be invoked inside deploy scripts, not invoked on
# their own.
@@ -166,6 +186,24 @@ namespace :rails do
}
end
+ # ### rails:db_create
+ desc "Creates the Rails database."
+ task :'db_create' do
+ queue %{
+ echo "-----> Creating database"
+ #{echo_cmd %[#{rake} db:create]}
+ }
+ end
+
+ # ### rails:db_rollback
+ desc "Rollbacks the Rails database."
+ task :'db_rollback' do
+ queue %{
+ echo "-----> Rollbacking database"
+ #{echo_cmd %[#{rake} db:rollback]}
+ }
+ end
+
# ### rails:assets_precompile:force
desc "Precompiles assets."
task :'assets_precompile:force' do
@@ -186,11 +224,12 @@ namespace :rails do
'Precompiling asset files'
queue check_for_changes_script \
- :check => 'public/assets/',
+ :check => compiled_asset_path,
:at => [*asset_paths],
:skip => %[
echo "-----> Skipping asset precompilation"
- #{echo_cmd %[cp -R "#{deploy_to}/#{current_path}/public/assets" "./public"]}
+ #{echo_cmd %[mkdir -p "#{deploy_to}/$build_path/#{compiled_asset_path}"]}
+ #{echo_cmd %[cp -R "#{deploy_to}/#{current_path}/#{compiled_asset_path}/." "#{deploy_to}/$build_path/#{compiled_asset_path}"]}
],
:changed => %[
echo "-----> #{message}"
diff --git a/lib/mina/rake.rb b/lib/mina/rake.rb
index 3fb9ea7..3238954 100644
--- a/lib/mina/rake.rb
+++ b/lib/mina/rake.rb
@@ -2,6 +2,7 @@
extend Mina::Helpers
extend Mina::DeployHelpers
extend Mina::SshHelpers
+extend Mina::LocalHelpers
extend Mina::OutputHelpers
extend Mina::ExecHelpers
diff --git a/lib/mina/ry.rb b/lib/mina/ry.rb
new file mode 100644
index 0000000..4b4e1df
--- /dev/null
+++ b/lib/mina/ry.rb
@@ -0,0 +1,55 @@
+# # Modules: ry
+# Adds settings and tasks for managing [ry] installations.
+#
+# [ry]: https://github.com/jneen/ry
+#
+# require 'mina/ry'
+#
+# ## Common usage
+#
+# task :environment do
+# invoke :'ry[ruby-1.9.3-p392]'
+# # or without parameter to use default ruby version
+# invoke :'ry'
+# end
+#
+# task :deploy => :environment do
+# ...
+# end
+
+# ## Settings
+# Any and all of these settings can be overriden in your `deploy.rb`.
+
+# ### ry_path
+# Path where *ry* init scripts are installed.
+#
+set_default :ry_path, "$HOME/.local"
+
+# ## Tasks
+
+# ### ry[version]
+# Switch to given Ruby version
+
+task :ry, :env do |t, args|
+ unless args[:env]
+ print_status "Task 'ry' without argument will use default Ruby version."
+ end
+
+ queue %{
+ echo "-----> ry to version: '#{args[:env] || '**not specified**'}'"
+
+ echo "-----> Loading ry"
+ if [[ ! -e "#{ry_path}/bin" ]]; then
+ echo "! ry not found"
+ echo "! If ry is installed, check your :ry_path setting."
+ exit 1
+ fi
+ #{echo_cmd %{export PATH="#{ry_path}/bin:$PATH"}}
+ #{echo_cmd %{eval "$(ry setup)"}}
+
+ RY_RUBY="#{args[:env]}"
+ if [ -n "$RY_RUBY" ]; then
+ #{echo_cmd %{ry use $RY_RUBY}} || exit 1
+ fi
+ }
+end
diff --git a/lib/mina/ssh_helpers.rb b/lib/mina/ssh_helpers.rb
index 8b059a0..9d6ec94 100644
--- a/lib/mina/ssh_helpers.rb
+++ b/lib/mina/ssh_helpers.rb
@@ -22,6 +22,7 @@ module Mina
def ssh(cmd, options={})
require 'shellwords'
+ cmd.unshift("export #{env_vars}") if env_vars?
cmd = cmd.join("\n") if cmd.is_a?(Array)
script = Shellwords.escape(cmd)
@@ -52,7 +53,8 @@ module Mina
args << " -i #{identity_file}" if identity_file?
args << " -p #{port}" if port?
args << " -A" if forward_agent?
- args << " #{ssh_options}" if ssh_options?
+ args << " #{ssh_options}" if ssh_options?
+ args << " -o StrictHostKeyChecking=no"
args << " -t"
"ssh #{args}"
end
diff --git a/lib/mina/version.rb b/lib/mina/version.rb
index 431af7a..8c8bcee 100644
--- a/lib/mina/version.rb
+++ b/lib/mina/version.rb
@@ -1,5 +1,5 @@
module Mina
def self.version
- "0.3.1"
+ "0.3.7"
end
end
diff --git a/lib/mina/whenever.rb b/lib/mina/whenever.rb
index 756c0c0..ee4b993 100644
--- a/lib/mina/whenever.rb
+++ b/lib/mina/whenever.rb
@@ -1,27 +1,48 @@
# # Modules: Whenever
# Adds settings and tasks for managing projects with [whenever].
+#
# [whenever]: http://rubygems.org/gems/whenever
+#
+#
+# ## Common usage
+# require 'mina/whenever'
+#
+# task :deploy => :environment do
+# deploy do
+# ...
+# to :launch do
+# invoke :'whenever:update'
+# end
+# end
+
+# ## Settings
+# Any and all of these settings can be overriden in your `deploy.rb`.
+
+# ### whenever_name
+# Sets the name for whenever_name.
+
+set_default :whenever_name, "#{domain}_#{rails_env}"
namespace :whenever do
desc "Clear crontab"
- task :clear do
+ task :clear => :environment do
queue %{
- echo "-----> Clear crontab for #{domain}_#{rails_env}"
- #{echo_cmd %[cd #{deploy_to!}/#{current_path!} ; #{bundle_bin} exec whenever --clear-crontab #{domain}_#{rails_env} --set 'environment=#{rails_env}&path=#{deploy_to!}/#{current_path!}']}
+ echo "-----> Clear crontab for #{whenever_name}"
+ #{echo_cmd %[cd #{deploy_to!}/#{current_path!} ; #{bundle_bin} exec whenever --clear-crontab #{whenever_name} --set 'environment=#{rails_env}&path=#{deploy_to!}/#{current_path!}']}
}
end
desc "Update crontab"
- task :update do
+ task :update => :environment do
queue %{
- echo "-----> Update crontab for #{domain}_#{rails_env}"
- #{echo_cmd %[cd #{deploy_to!}/#{current_path!} ; #{bundle_bin} exec whenever --update-crontab #{domain}_#{rails_env} --set 'environment=#{rails_env}&path=#{deploy_to!}/#{current_path!}']}
+ echo "-----> Update crontab for #{whenever_name}"
+ #{echo_cmd %[cd #{deploy_to!}/#{current_path!} ; #{bundle_bin} exec whenever --update-crontab #{whenever_name} --set 'environment=#{rails_env}&path=#{deploy_to!}/#{current_path!}']}
}
end
desc "Write crontab"
- task :write do
+ task :write => :environment do
queue %{
- echo "-----> Update crontab for #{domain}_#{rails_env}"
- #{echo_cmd %[cd #{deploy_to!}/#{current_path!} ; #{bundle_bin} exec whenever --write-crontab #{domain}_#{rails_env} --set 'environment=#{rails_env}&path=#{deploy_to!}/#{current_path!}']}
+ echo "-----> Update crontab for #{whenever_name}"
+ #{echo_cmd %[cd #{deploy_to!}/#{current_path!} ; #{bundle_bin} exec whenever --write-crontab #{whenever_name} --set 'environment=#{rails_env}&path=#{deploy_to!}/#{current_path!}']}
}
end
end
diff --git a/metadata.yml b/metadata.yml
index c4a145d..b286b4b 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,84 +1,85 @@
---- !ruby/object:Gem::Specification
+--- !ruby/object:Gem::Specification
name: mina
-version: !ruby/object:Gem::Version
- hash: 17
- prerelease:
- segments:
- - 0
- - 3
- - 1
- version: 0.3.1
+version: !ruby/object:Gem::Version
+ version: 0.3.7
platform: ruby
-authors:
+authors:
- Rico Sta. Cruz
- Michael Galero
autorequire:
bindir: bin
cert_chain: []
-
-date: 2014-10-17 00:00:00 +02:00
-default_executable:
-dependencies:
-- !ruby/object:Gem::Dependency
+date: 2015-07-08 00:00:00.000000000 Z
+dependencies:
+- !ruby/object:Gem::Dependency
name: rake
- prerelease: false
- requirement: &id001 !ruby/object:Gem::Requirement
- none: false
- requirements:
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
- - ">="
- - !ruby/object:Gem::Version
- hash: 3
- segments:
- - 0
- version: "0"
+ - !ruby/object:Gem::Version
+ version: '0'
type: :runtime
- version_requirements: *id001
-- !ruby/object:Gem::Dependency
- name: open4
prerelease: false
- requirement: &id002 !ruby/object:Gem::Requirement
- none: false
- requirements:
- - - ~>
- - !ruby/object:Gem::Version
- hash: 19
- segments:
- - 1
- - 3
- - 4
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ version: '0'
+- !ruby/object:Gem::Dependency
+ name: open4
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - "~>"
+ - !ruby/object:Gem::Version
version: 1.3.4
type: :runtime
- version_requirements: *id002
-- !ruby/object:Gem::Dependency
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - "~>"
+ - !ruby/object:Gem::Version
+ version: 1.3.4
+- !ruby/object:Gem::Dependency
name: rspec
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - "~>"
+ - !ruby/object:Gem::Version
+ version: 3.0.0
+ type: :development
prerelease: false
- requirement: &id003 !ruby/object:Gem::Requirement
- none: false
- requirements:
- - - ~>
- - !ruby/object:Gem::Version
- hash: 7
- segments:
- - 3
- - 0
- - 0
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - "~>"
+ - !ruby/object:Gem::Version
version: 3.0.0
+- !ruby/object:Gem::Dependency
+ name: pry
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - "~>"
+ - !ruby/object:Gem::Version
+ version: 0.9.0
type: :development
- version_requirements: *id003
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - "~>"
+ - !ruby/object:Gem::Version
+ version: 0.9.0
description: Really fast deployer and server automation tool.
-email:
+email:
- rico at nadarei.co
- mikong at nadarei.co
-executables:
+executables:
- mina
extensions: []
-
extra_rdoc_files: []
-
-files:
-- .gitignore
-- .rspec
-- .travis.yml
+files:
+- ".gitignore"
+- ".rspec"
+- ".travis.yml"
+- CHANGELOG.md
- CONTRIBUTING.md
- Gemfile
- HISTORY.md
@@ -100,11 +101,14 @@ files:
- lib/mina/foreman.rb
- lib/mina/git.rb
- lib/mina/helpers.rb
+- lib/mina/local_helpers.rb
+- lib/mina/npm.rb
- lib/mina/output_helpers.rb
- lib/mina/rails.rb
- lib/mina/rake.rb
- lib/mina/rbenv.rb
- lib/mina/rvm.rb
+- lib/mina/ry.rb
- lib/mina/settings.rb
- lib/mina/ssh_helpers.rb
- lib/mina/tools.rb
@@ -130,47 +134,38 @@ files:
- spec/fixtures/custom_file_env/custom_deploy.rb
- spec/fixtures/empty_env/config/deploy.rb
- spec/helpers/exec_helper_spec.rb
+- spec/helpers/local_helper_spec.rb
- spec/helpers/output_helper_spec.rb
- spec/spec_helper.rb
- support/Readme-footer.md
- support/Readme-header.md
- support/guide.md
- support/index.html
+- support/third_party_modules.md
- support/to_md.rb
- test_env/config/deploy.rb
-has_rdoc: true
homepage: http://github.com/nadarei/mina
licenses: []
-
+metadata: {}
post_install_message:
rdoc_options: []
-
-require_paths:
+require_paths:
- lib
-required_ruby_version: !ruby/object:Gem::Requirement
- none: false
- requirements:
+required_ruby_version: !ruby/object:Gem::Requirement
+ requirements:
- - ">="
- - !ruby/object:Gem::Version
- hash: 3
- segments:
- - 0
- version: "0"
-required_rubygems_version: !ruby/object:Gem::Requirement
- none: false
- requirements:
+ - !ruby/object:Gem::Version
+ version: '0'
+required_rubygems_version: !ruby/object:Gem::Requirement
+ requirements:
- - ">="
- - !ruby/object:Gem::Version
- hash: 3
- segments:
- - 0
- version: "0"
+ - !ruby/object:Gem::Version
+ version: '0'
requirements: []
-
rubyforge_project:
-rubygems_version: 1.6.2
+rubygems_version: 2.4.5
signing_key:
-specification_version: 3
+specification_version: 4
summary: Really fast deployer and server automation tool.
test_files: []
-
+has_rdoc:
diff --git a/mina.gemspec b/mina.gemspec
index a1ed854..b677b51 100644
--- a/mina.gemspec
+++ b/mina.gemspec
@@ -14,4 +14,5 @@ Gem::Specification.new do |s|
s.add_dependency "rake"
s.add_dependency "open4", "~> 1.3.4"
s.add_development_dependency "rspec", "~> 3.0.0"
+ s.add_development_dependency "pry", "~> 0.9.0"
end
diff --git a/spec/commands/deploy_spec.rb b/spec/commands/deploy_spec.rb
index 34748e3..4ffd11d 100644
--- a/spec/commands/deploy_spec.rb
+++ b/spec/commands/deploy_spec.rb
@@ -29,6 +29,10 @@ describe "Invoking the 'mina' command in a project" do
expect(stdout).to include "bundle exec rake db:migrate"
end
+ it "should include 'to :build' directives" do
+ stdout.should include "touch build.txt"
+ end
+
it "should include 'to :launch' directives" do
expect(stdout).to include "touch tmp/restart.txt"
end
diff --git a/spec/commands/real_deploy_spec.rb b/spec/commands/real_deploy_spec.rb
index 9067106..fe0a82d 100644
--- a/spec/commands/real_deploy_spec.rb
+++ b/spec/commands/real_deploy_spec.rb
@@ -30,6 +30,7 @@ describe "Invoking the 'mina' command in a project", :ssh => true do
print "[deploy 1]" if ENV['verbose']
mina 'deploy', '--verbose'
expect(stdout).to include "-----> Creating a temporary build path"
+ expect(stdout).to include "git rev-parse HEAD > .mina_git_revision"
expect(stdout).to include "rm -rf .git"
expect(stdout).to include "mkdir -p"
expect(File.exists?('deploy/last_version')).to be_truthy
@@ -41,6 +42,7 @@ describe "Invoking the 'mina' command in a project", :ssh => true do
expect(File.exists?('deploy/current')).to be_truthy
expect(File.read('deploy/last_version').strip).to eq('1')
expect(File.exists?('deploy/current/tmp/restart.txt')).to be_truthy
+ expect(File.exists?('deploy/current/.mina_git_revision')).to be_truthy
# And again, to test out sequential versions and stuff
print "[deploy 2]" if ENV['verbose']
@@ -49,5 +51,6 @@ describe "Invoking the 'mina' command in a project", :ssh => true do
expect(stdout).not_to include "mkdir -p"
expect(File.directory?('deploy/releases/2')).to be_truthy
expect(File.read('deploy/last_version').strip).to eq('2')
+ expect(File.exists?('deploy/current/.mina_git_revision')).to be_truthy
end
end
diff --git a/spec/dsl/invoke_spec.rb b/spec/dsl/invoke_spec.rb
index 011d81f..4c70435 100644
--- a/spec/dsl/invoke_spec.rb
+++ b/spec/dsl/invoke_spec.rb
@@ -39,6 +39,7 @@ describe 'Mina' do
end
}
+
%w(World Pirate).each { |name|
rake { invoke :"hello[#{name}]", :reenable => true }
}
diff --git a/spec/helpers/local_helper_spec.rb b/spec/helpers/local_helper_spec.rb
new file mode 100644
index 0000000..7dcee3f
--- /dev/null
+++ b/spec/helpers/local_helper_spec.rb
@@ -0,0 +1,70 @@
+require 'spec_helper'
+
+describe Mina::LocalHelpers::Local do
+ describe '.invoke' do
+ let :scope do
+ double("rake_application").tap do |scope|
+ allow(scope).to receive(:settings).and_return(settings)
+ end
+ end
+
+ let(:settings) { OpenStruct.new }
+
+ it 'uses the pretty system with shell-escaped command when term_mode is set to :pretty and pretty is supported' do
+ settings.term_mode = :pretty
+ cmd = %[echo "hello"]
+
+ allow(described_class).to receive(:pretty_supported?).and_return(true)
+ expect(scope).to receive(:pretty_system).with(Shellwords.escape(cmd)).and_return(0)
+
+ described_class.invoke(cmd, scope)
+ end
+
+ it 'does NOT use the pretty system when term_mode is set to :pretty and pretty is NOT supported' do
+ settings.term_mode = :pretty
+ cmd = %[echo "hello"]
+
+ allow(described_class).to receive(:pretty_supported?).and_return(false)
+ expect(scope).not_to receive(:pretty_system)
+ expect(Kernel).to receive(:exec).and_return(0)
+
+ described_class.invoke(cmd, scope)
+ end
+
+ it 'returns the sub-shell exit status when using the pretty system' do
+ settings.term_mode = :pretty
+
+ allow(described_class).to receive(:pretty_supported?).and_return(true)
+ allow(scope).to receive(:pretty_system).with("return0").and_return(0)
+ allow(scope).to receive(:pretty_system).with("return13").and_return(13)
+
+ expect(described_class.invoke("return0", scope)).to eq 0
+ expect(described_class.invoke("return13", scope)).to eq 13
+ end
+
+ it 'calls Kernel.exec with non shell-escaped command when term_mode is :exec' do
+ settings.term_mode = :exec
+ cmd = %[echo "hello"]
+
+ expect(Kernel).to receive(:exec).with(cmd).and_return(0)
+
+ described_class.invoke(cmd, scope)
+ end
+
+ it 'calls Kernel.system with non shell-escaped command when term_mode is not :pretty nor :exec' do
+ settings.term_mode = nil
+ cmd = %[echo "hello"]
+
+ expect(Kernel).to receive(:system).with(cmd).and_return("hello\n")
+
+ described_class.invoke(cmd, scope)
+ end
+
+ it 'returns the sub-shell exit status when using Kernel.system' do
+ settings.term_mode = nil
+
+ expect(described_class.invoke(%[/bin/sh -c 'exit 0'], scope)).to eq 0
+ expect(described_class.invoke(%[/bin/sh -c 'exit 13'], scope)).to eq 13
+ end
+ end
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index fd8ad09..04c4f99 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -10,6 +10,7 @@ class RakeScope
include Rake::DSL if Rake.const_defined?(:DSL)
include Mina::Helpers
include Mina::SshHelpers
+ include Mina::LocalHelpers
end
def rake(&blk)
diff --git a/support/Readme-footer.md b/support/Readme-footer.md
index 1bc7461..cf92b5b 100644
--- a/support/Readme-footer.md
+++ b/support/Readme-footer.md
@@ -2,8 +2,7 @@
Acknowledgements
----------------
-© 2012-2014, Nadarei. Released under the [MIT
-License](http://www.opensource.org/licenses/mit-license.php).
+© 2012-2015, Nadarei. Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
Mina is authored and maintained by [Rico Sta. Cruz][rsc] and [Michael
Galero][mg] with help from its [contributors][c]. It is sponsored by our
@@ -25,8 +24,8 @@ Michael:
[rsc]: http://ricostacruz.com
[mg]: http://devblog.michaelgalero.com/
-[c]: http://github.com/nadarei/mina/contributors
+[c]: http://github.com/mina-deploy/mina/graphs/contributors
[nd]: http://nadarei.co
-[issues]: https://github.com/nadarei/mina/issues
+[issues]: https://github.com/mina-deploy/mina/issues
[trello]: https://trello.com/board/mina/4fc8b3023d9c9a4d72e573e6
diff --git a/support/Readme-header.md b/support/Readme-header.md
index 0d5d834..5299b9b 100644
--- a/support/Readme-header.md
+++ b/support/Readme-header.md
@@ -13,4 +13,4 @@ session per deploy, minimizing the SSH connection overhead.
$ gem install mina
$ mina
-[](https://travis-ci.org/mina-deploy/mina) [](http://badge.fury.io/rb/mina)
+[](https://travis-ci.org/mina-deploy/mina) [](http://badge.fury.io/rb/mina) [](http://inch-ci.org/github/mina-deploy/mina)
diff --git a/support/guide.md b/support/guide.md
index 3929930..a1d4dc5 100644
--- a/support/guide.md
+++ b/support/guide.md
@@ -283,7 +283,7 @@ Basic usage:
### Tasks
-There are many tasks available. See the [tasks reference](tasks/index.html), or
+There are many tasks available. See the [tasks reference](http://mina-deploy.github.io/mina/tasks/), or
type `mina tasks`.
### Variables
diff --git a/support/third_party_modules.md b/support/third_party_modules.md
new file mode 100644
index 0000000..c27dff2
--- /dev/null
+++ b/support/third_party_modules.md
@@ -0,0 +1,23 @@
+3rd party modules
+------
+
+* [mina-rollbar](https://github.com/code-lever/mina-rollbar)
+* [mina-stack](https://github.com/div/mina-stack)
+* [mina-rsync](https://github.com/moll/mina-rsync)
+* [mina-sidekiq](https://github.com/Mic92/mina-sidekiq)
+* [mina-delayed_job](https://github.com/d4be4st/mina-delayed_job)
+* [mina-nginx](https://github.com/hbin/mina-nginx)
+* [mina-newrelic](https://github.com/navinpeiris/mina-newrelic)
+* [mina-rbenv-addons](https://github.com/stas/mina-rbenv-addons)
+* [mina-multistage](https://github.com/endoze/mina-multistage)
+* [mina-s3](https://github.com/stas/mina-s3)
+* [mina-scp](https://github.com/adie/mina-scp)
+* [mina-hooks](https://github.com/elskwid/mina-hooks)
+* [mina-slack](https://github.com/TAKAyukiatkwsk/mina-slack)
+* [mina-cakephp](https://github.com/mobvox/mina-cakephp)
+* [mina-unicorn](https://github.com/openteam/mina-unicorn)
+* [mina-puma](https://github.com/sandelius/mina-puma)
+* [mina-mercurial](https://github.com/rainlabs/mina-mercurial)
+* [mina-faye](https://github.com/NingenUA/mina-faye)
+* [mina-clockwork](https://github.com/907th/mina-clockwork)
+* [mina-ftp](https://github.com/stas/mina-ftp)
diff --git a/test_env/config/deploy.rb b/test_env/config/deploy.rb
index 881b2bf..8c3edaa 100644
--- a/test_env/config/deploy.rb
+++ b/test_env/config/deploy.rb
@@ -19,6 +19,7 @@ File.open("#{Dir.pwd}/deploy/config/database.yml", 'w') { |f| f.write "Hello" }
require 'mina/rails'
require 'mina/bundler'
require 'mina/git'
+require 'pry'
set :domain, 'localhost'
set :deploy_to, "#{Dir.pwd}/deploy"
@@ -35,13 +36,22 @@ desc "Deploys."
task :deploy => :environment do
queue "bundle() { true; }" # Stub the bundle command.
+ to :before_hook do
+ queue %[ echo "-----> This is before hook"]
+ end
+
deploy do
- queue %[ruby -e "\\$stderr.write \\\"This is stdout output\n\\\""]
- invoke :'git:clone'
- invoke :'deploy:link_shared_paths'
- invoke :'bundle:install'
- invoke :'rails:db_migrate'
+ to :default do
+ queue %[ruby -e "\\$stderr.write \\\"This is stdout output\n\\\""]
+ invoke :'git:clone'
+ invoke :'deploy:link_shared_paths'
+ invoke :'bundle:install'
+ invoke :'rails:db_migrate'
+ end
+ to :build do
+ queue "touch build.txt"
+ end
to :launch do
invoke :'passenger:restart'
end
@@ -50,7 +60,17 @@ end
desc "Restarts the passenger server."
task :restart do
+ set :term_mode, :pretty
+ to :before do
+ queue %(
+ echo "-----> Copying files"
+ #{echo_cmd %[cp deploy/last_version deploy/last_version_2]}
+ )
+ end
invoke :'passenger:restart'
+ to :after do
+ queue "echo '-----> After'"
+ end
end
namespace :passenger do
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-mina.git
More information about the Pkg-ruby-extras-commits
mailing list