Mina::Proteus
Plugin for Mina that adds support for multiple stages and multiple apps to Mina, specifically built for Hanami ruby framework. This gem is based on endoze's mina-multistage gem, huge thanks to him!
Installation & Usage
Add this line to your application's Gemfile:
gem 'mina-proteus', require: false
And then execute:
$ bundle install
Or install it yourself as:
$ gem install mina-proteus
Require mina/proteus in your config/deploy.rb:
require 'mina/proteus'
require 'mina/bundler'
require 'mina/git'
...
task setup: do
...
end
desc 'Deploys the current version to the server.'
task deploy: do
...
end
You then need to specify your hanami apps like this:
set :hanami_apps, %w(app1 app2 app3)
That's the only required parameter, optional parameters are:
# config/deploy.rb
set :stages, %w(staging production) #specify your stages
set :stages_dir, 'config/deploy' #specify which directory will have all the configurations files
set :default_stage, 'staging' #specify your default stage
set :bundle_prefix, -> { %{HANAMI_ENV="#{fetch(:current_stage)}" HANAMI_APPS="#{fetch(:current_app)}" #{fetch(:bundle_bin)} exec} } #used to deploy a single application in a specific environment
Then to create every file run:
$ bundle exec mina proteus:init
This will create config/deploy/staging.rb and config/deploy/production.rb stage files and
config/deploy/staging/app1.rb, config/deploy/staging/app1.rb, etc.
Use them to define stage and app specific configuration.
Now you can deploy the default stage with:
$ mina <APP-NAME> deploy # this deploys staging by default
Or specify a stage explicitly:
$ mina staging <APP-NAME> deploy
$ mina production <APP-NAME> deploy
Maintenance
I'll be rearely maintaining this gem due to lack of time, if you want to contibute feel free to fork it, branch it and then create a pull request
