Sha256: 6a491d215426ba0bbcb5065727bf032dc4a161d18d26353a0aea4962ee485918

Contents?: true

Size: 1.33 KB

Versions: 16

Compression:

Stored size: 1.33 KB

Contents

require 'rails/generators'

module Alchemy
  module Generators
    class DeployScriptGenerator < ::Rails::Generators::Base

      desc "This generator generates a Capistrano deploy script."
      class_option :scm, :type => :string, :desc => "Set the type of scm you use for deployment.", :default => 'svn'
      class_option :db, :type => :string, :desc => "Set the type of database you use on your server.", :default => 'mysql'
      source_root File.expand_path('templates', File.dirname(__FILE__))

      def copy_script
        @ssh_user = ask('Please enter SSH username:')
        @ssh_password = ask('Please enter SSH password:')
        port = ask('Please enter SSH port (22):')
        @ssh_port = port.blank? ? 22 : port
        @server = ask('Please enter server ip or domain:')
        @deploy_path = ask('Please enter the path to the public html folder:')
        @scm = options[:scm]
        @repository_url = ask('Please enter the URL to your projects repository:')
        if @scm == "svn" && yes?('Is your repository private? (y/N)')
          @scm_user = ask('Please enter the username for your repository:')
          @scm_password = ask('Please enter the password to your repository:')
        end
        @database_type = options[:db]
        template "deploy.rb.tt", Rails.root.join('config', 'deploy.rb')
      end

    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
alchemy_cms-2.2.4 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.3.2 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.3.1 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.2 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.1 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.0 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.rc15 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.rc14 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.rc13 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.rc11 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.rc8 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.rc7 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.rc6 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.rc3 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.rc2 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb
alchemy_cms-2.2.rc1 lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb