Class: Pushwagner::Maven::Deployer

Inherits:
Object
  • Object
show all
Defined in:
lib/pushwagner/maven.rb

Overview

Deployer strategy for maven repos (wip).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, opts = {}) ⇒ Deployer

Returns a new instance of Deployer.



109
110
111
112
113
114
# File 'lib/pushwagner/maven.rb', line 109

def initialize(env, opts = {})
  @environment = env
  # TODO: nil-object instead?
  @artifacts = env.maven? ? env.maven.artifacts : {}
  @repository = env.maven? ? env.maven.repository : nil
end

Instance Attribute Details

#artifactsObject (readonly)

Returns the value of attribute artifacts.



107
108
109
# File 'lib/pushwagner/maven.rb', line 107

def artifacts
  @artifacts
end

#environmentObject (readonly)

Returns the value of attribute environment.



107
108
109
# File 'lib/pushwagner/maven.rb', line 107

def environment
  @environment
end

#repositoryObject (readonly)

Returns the value of attribute repository.



107
108
109
# File 'lib/pushwagner/maven.rb', line 107

def repository
  @repository
end

Instance Method Details

#deployObject



116
117
118
119
120
121
122
123
124
125
# File 'lib/pushwagner/maven.rb', line 116

def deploy
  artifacts.each do |name, artifact|
    environment.hosts.each do |host|
      mark_previous(name, host)
      pull_artifact(name, artifact, host)
      mark_new(name, artifact, host)
    end
  end
  true # false if failed
end