Sha256: 71d2ac6d29e7a4807ff6ce99d6c7d5e98b9b12f82407d716c530a119459b9b8b

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

module Initial
  class CapistranoGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __FILE__)

    def add
      gem_group :development do
        gem 'capistrano'
        gem 'capistrano-rbenv'
        gem 'capistrano-bundler'
        gem 'capistrano-rails'
        gem 'capistrano-sidekiq' , github: 'seuros/capistrano-sidekiq'
        gem 'capistrano3-puma'
      end

      Bundler.with_clean_env do
        run "bundle install"
      end

      directory 'capistrano/tasks', 'lib/capistrano/tasks'
      directory 'capistrano/shared', 'config/deploy/shared'

      run 'cap install'

      uncomment_lines 'Capfile', /require 'capistrano\/rbenv'/
      uncomment_lines 'Capfile', /require 'capistrano\/bundler'/
      uncomment_lines 'Capfile', /require 'capistrano\/rails\/assets'/
      uncomment_lines 'Capfile', /require 'capistrano\/rails\/migrations'/
      insert_into_file "Capfile", "require 'capistrano/sidekiq'\n",
                       after: "require 'capistrano/rails/migrations'\n"
      insert_into_file "Capfile", "require 'capistrano/puma'\n",
                       after: "require 'capistrano/sidekiq'\n"
      insert_into_file "Capfile", "require 'capistrano/puma/monit'\n",
                       after: "require 'capistrano/sidekiq'\n"

      copy_file 'capistrano/deploy/deploy.rb', 'config/deploy.rb'
      copy_file 'capistrano/deploy/production.rb', 'config/deploy/production.rb'

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
teleporter-0.0.19 lib/generators/initial/capistrano.rb
teleporter-0.0.18 lib/generators/initial/capistrano.rb
teleporter-0.0.17 lib/generators/initial/capistrano.rb