Readme.md in mina-0.3.3 vs Readme.md in mina-0.3.4

- old
+ new

@@ -54,17 +54,17 @@ ~@your.server.com$ chown -R username /var/www/flipstack.com ### Step 3: Run 'mina setup' Back at your computer, do `mina setup` to set up the [folder -structure](#directory-structure) in this path. This will connect to your server +structure](#directory_structure) in this path. This will connect to your server 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! Use `mina deploy` to run the `deploy` task defined in *config/deploy.rb*. @@ -197,12 +197,11 @@ invoke :'git:clone' invoke :'bundle:install' # 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. to :clean do queue 'log "failed deployment"' @@ -298,11 +297,11 @@ * `-V` / `--version` - Shows the current version. ### 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 You may specify additional variables in the `KEY=value` style, just like Rake. @@ -314,22 +313,25 @@ # 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. ~~~ ruby 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. ~~~ ruby a = 1 @@ -352,10 +354,26 @@ 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. ~~~ ruby @@ -611,10 +629,13 @@ 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. ## Deploy tasks These tasks are meant to be invoked inside deploy scripts, not invoked on @@ -647,11 +668,11 @@ ### ssh_options Switches to be passed to the `ssh` command. ### env_vars -Environment variables passed to the `ssh` command (e.g. "foo=bar baz=1"). +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`. ### environment @@ -728,18 +749,32 @@ 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. ### run[] Runs a command on a server. ~~~ ruby -$ mina run[tail -f logs.txt] +$ mina "run[tail -f logs.txt]" ~~~ # Modules: Foreman Adds settings and tasks for managing projects with [foreman]. @@ -749,25 +784,26 @@ require 'mina/foreman' ## Common usage -~~~ ruby -set :application, "app-name" + set :application, "app-name" -task :deploy => :environment do - deploy do - # ... - invoke 'foreman:export' - # ... - end - to :launch do - invoke 'foreman:restart' - end -end + task :deploy => :environment do +~~~ ruby + deploy do + # ... + invoke 'foreman:export' + # ... + end + to :launch do + invoke 'foreman:restart' + end ~~~ + end + ## Settings Any and all of these settings can be overriden in your `deploy.rb`. ### foreman_app Sets the service name that foreman will export to upstart. Uses *application* @@ -864,18 +900,18 @@ ### rails[] 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 Opens the Ruby console for the currently-deployed version. @@ -889,10 +925,12 @@ ### rails:db_migrate ### rails:db_migrate:force +### rails:db_rollback + ### rails:assets_precompile:force ### rails:assets_precompile # Modules: rbenv @@ -980,42 +1018,76 @@ ... invoke :'rvm:wrapper[ruby-1.9.3-p125@gemset_name,wrapper_name,binary_name]' end ~~~ -Adds settings and tasks for managing projects with [whenever]. -[whenever]: http://rubygems.org/gems/whenever +Adds settings and tasks for managing Node packages. - -# Modules: NPM -Adds settings and tasks for managing NodeJS projects. - ~~~ 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 -Parameters to pass to the npm binary. Default to `--production`. +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. + +### bower:install +Installs bower modules. Takes into account if executed `in_directory` and namespaces the installed modules in the shared folder. + +# 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 + ... + invoke :'whenever:update' +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) @@ -1031,11 +1103,11 @@ * [mina-ftp](https://github.com/stas/mina-ftp) Acknowledgements ---------------- -© 2012-2014, Nadarei. Released under the [MIT +© 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 startup, [Nadarei][nd]. @@ -1054,9 +1126,10 @@ * [My website][mg] (michaelgalero.com) * [Github](http://github.com/mikong) (@mikong) [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 +