Capistrano-rpush

Capistrano3 plugin to control RPush installations

View the Project on GitHub juicyparts/capistrano-rpush

Gem Version

Capistrano::Rpush

Capistrano::Rpush adds Rpush tasks to your Capistrano deployment.

Rpush

This gem was developed against version 2.7.0. Additionally it only provides tasks over a subset of available commands:

$ rpush --help
Commands:
  rpush help [COMMAND]  # Describe available commands or one specific command
  rpush init            # Initialize Rpush into the current directory
  rpush push            # Deliver all pending notifications and then exit
  rpush start           # Start Rpush
  rpush status          # Show the internal status of the running Rpush instance.
  rpush stop            # Stop Rpush
  rpush version         # Print Rpush version

Options:
  -c, [--config=CONFIG]
                               # Default: config/initializers/rpush.rb
  -e, [--rails-env=RAILS-ENV]
                               # Default: development

Installation

Add this line to your application's Gemfile:

gem 'capistrano-rpush'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capistrano-rpush

Usage

  # In Rails.root/Capfile


  require 'capistrano/rpush'

Now you can use cap -T to list tasks:

cap rpush:restart  # Restart rpush
cap rpush:start    # Start rpush
cap rpush:status   # Status rpush
cap rpush:stop     # Stop rpush

Configuration

The following configurable options are available, and listed with their defaults. Override them to suit your project's needs:

  set :rpush_role, :app
  set :rpush_env,  -> { fetch(:rack_env, fetch(:rails_env, fetch(:stage))) }
  set :rpush_conf, -> { File.join(shared_path, 'config', 'rpush.rb') }
  set :rpush_log,  -> { File.join(shared_path, 'log', 'rpush.log') }
  set :rpush_pid,  -> { File.join(shared_path, 'tmp', 'pids', 'rpush.pid') }

The options assume rpush.rb is defined in linked_files. They also assume the following directories are listed in linked_dirs:

tmp/pids log

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/juicyparts/capistrano-rpush. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.