No commit activity in last 3 years
No release in over 3 years
Simple uWSGI management with capistrano
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

< 3, >= 2.15.5
< 5, >= 3.2.14
 Project Readme

Capistrano::Uwsgi

This gem provides two capistrano tasks:

  • uwsgi:setup - creates /etc/uwsgi/apps-enabled/#{application}-#{stage}.ini
  • uwsgi:restart - touches uwsgi_ini (see below)

And uWSGI configuration file generator, that will create local copy of default uWSGI config for customization.

Installation

Add this line to your application's Gemfile:

gem 'capistrano-uwsgi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capistrano-uwsgi

Usage

Add this to your config/deploy.rb file:

require 'capistrano/uwsgi/tasks'

Make sure, following variables are defined in your config/deploy.rb:

  • application - application name
  • stage - the stage (usually from capistrano/ext/multistage)
  • user - remote user name
  • group - remote group name
  • rack_env - RACK_ENV used to run the app
  • deploy_to - deployment path
  • uwsgi_mode - can be either :standalone or :emperor
  • app_port - application port (required by the :standalone mode)
  • rvm_path - set this var to enable rvm usage inside uWSGI (optional)
  • uwsgi_ini - the path of the compiled uwsgi.ini config file (optional, defaults to: /etc/uwsgi/apps-enabled/#{application}-#{stage}.ini)

Launch new tasks:

$ cap uwsgi:setup
$ cap uwsgi:restart

Or you can add hook to call this tasks after deploy:setup. Add to your config/deploy.rb:

after 'deploy:setup', 'uwsgi:setup', 'uwsgi:restart'

If you want to customize uWSGI configuration, just generate local uWSGI config before running uwsgi:setup:

$ rails generate capistrano:uwsgi:config

And then edit file config/uwsgi.ini.erb as you like.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits

Original project structure and README from Ivan Tkalin's capistrano-nginx.