Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

mgrachev/capistrano-hanami

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌸 Capistrano::Hanami

Hanami tasks for Capistrano v3:

  • cap deploy:migrate
  • cap deploy:compile_assets

Installation

Add this line to your application's Gemfile:

group :development do
  gem 'capistrano', '~> 3.7'
  gem 'capistrano-hanami', require: false
end

And then execute:

$ bundle

Then run the generator to create a basic set of configuration files:

$ bundle exec cap install

Usage

# Capfile
require 'capistrano/hanami' # It also requires bundler

You can tweak some Hanami-specific options in config/deploy.rb:

# If the environment differs from the stage name
set :hanami_env, 'staging'

# Defaults to :app role
set :migration_role, :db

# Defaults to the primary :app server
set :migration_servers, -> { primary(fetch(:migration_role)) }

# Defaults to false
# Skip migration if files in db/migrations were not modified
set :conditionally_migrate, true

# Defaults to [:web]
set :assets_roles, [:web, :app]

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mgrachev/capistrano-hanami.