Sha256: aa380c164eda1ebaf92a32047f1b40d08d8002a542b8136a5e5a807f7af92674

Contents?: true

Size: 850 Bytes

Versions: 4

Compression:

Stored size: 850 Bytes

Contents

module Pushwagner

  class Main
    def initialize(opts = {})
      begin
        @environment = Pushwagner::Environment.new(opts)
      rescue => e
        Pushwagner.severe e.message
        raise e
      end
    end

    def set_environment(env)
      @environment.current = env.to_s
    end

    def set_version(version)
      @environment.version = version.to_s
    end

    def deploy(opts = {})
      Pushwagner.info "Starting deployment to environment: #{@environment.current}"
      @environment.hosts.each { |h| Pushwagner.info "  - #{@environment.user}@#{h}" }
      
      pw_hooks = Hooks.new(@environment)
      pw_hooks.run(:before)

      Maven::Deployer.new(@environment, opts).deploy if @environment.maven?
      Static::Deployer.new(@environment, opts).deploy if @environment.static?

      pw_hooks.run(:after)
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pushwagner-0.0.2.6 lib/pushwagner/main.rb
pushwagner-0.0.2.5 lib/pushwagner/main.rb
pushwagner-0.0.2.4 lib/pushwagner/main.rb
pushwagner-0.0.2.3 lib/pushwagner/main.rb