Sha256: 20cc150506aaa1084dfd6b7b7e6d99384f02fea33a4450f9b176500dd430054f

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

require 'thor/group'

module Engineyard
  module Hudson
    class Server < Thor::Group
      include Thor::Actions
      
      argument :project_path
      
      class_option :plugins, :aliases => '-p', :desc => 'additional Hudson CI plugins (comma separated)'
      
      def self.source_root
        File.join(File.dirname(__FILE__), "server", "templates")
      end
      
      def cookbooks
        directory "cookbooks"
      end
      
      def attributes
        @plugins = %w[git github rake ruby greenballs] + (options[:plugins] || '').strip.split(/\s*,\s*/)
        template "attributes.rb.tt", "cookbooks/hudson_master/attributes/default.rb"
      end
      
      def readme
        say ""
        say "Finally:"
        say "* edit "; say "cookbooks/hudson_master/attributes/default.rb ", :yellow; say "as necessary."
        say "* run: "; say "ey recipes upload ", :green; say "# use --environment(-e) & --account(-c)"
        say "* run: "; say "ey recipes apply  ", :green; say "#   to select environment"
        say "* "; say "Boot your environment ", :yellow; say "if not already booted."
        say "When the recipe completes, your solo instance will host a Hudson CI!"
      end

      private
      def say(msg, color = nil)
        color ? shell.say(msg, color) : shell.say(msg)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
engineyard-hudson-0.2.0 lib/engineyard-hudson/cli/server.rb