Sha256: d8c9c520f2bc74d7b5a1a188929324091b552d784aaf0e4f5ea51052bf3e570d

Contents?: true

Size: 1.31 KB

Versions: 11

Compression:

Stored size: 1.31 KB

Contents

module Vpsb
  module Commands
    class Build
      include AskSupport
      def initialize(core)
        @core = core
      end

      def execute(params)
        web_role.call
        deploy_bags.call
        apps_bags.call
        db_postgres_role.call
        db_postgres_bags.call if core.present?(:db_postgres_json)
        es_role.call          if ask_to_confirm("Do you want configure elasticsearch")
        monit_role.call       if ask_to_confirm("Do you want configure monit(newrelic)")
        packages_bags.call    if ask_to_confirm("Do you want to install additional apt-get apps")
        node.call
      end

      private
      attr_reader :core

      def node
        Vpsb::Tasks::Node.new(core)
      end

      def apps_bags
        Vpsb::Tasks::AppsBags.new(core)
      end

      def deploy_bags
        Vpsb::Tasks::DeployBags.new(core)
      end

      def packages_bags
        Vpsb::Tasks::PackagesBags.new(core)
      end

      def db_postgres_bags
        Vpsb::Tasks::DbPostgresBags.new(core)
      end

      def db_postgres_role
        Vpsb::Tasks::DbPostgresRole.new(core)
      end

      def es_role
        Vpsb::Tasks::EsRole.new(core)
      end

      def monit_role
        Vpsb::Tasks::MonitRole.new(core)
      end

      def web_role
        Vpsb::Tasks::WebRole.new(core)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vpsb-1.1.0 lib/vpsb/commands/build.rb
vpsb-1.0.9 lib/vpsb/commands/build.rb
vpsb-1.0.8 lib/vpsb/commands/build.rb
vpsb-1.0.7 lib/vpsb/commands/build.rb
vpsb-1.0.6 lib/vpsb/commands/build.rb
vpsb-1.0.5 lib/vpsb/commands/build.rb
vpsb-1.0.4 lib/vpsb/commands/build.rb
vpsb-1.0.3 lib/vpsb/commands/build.rb
vpsb-1.0.2 lib/vpsb/commands/build.rb
vpsb-1.0.1 lib/vpsb/commands/build.rb
vpsb-1.0.0 lib/vpsb/commands/build.rb