Class: Physique::OctopusDeployConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/physique/task_builders/octopus.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOctopusDeployConfig

Returns a new instance of OctopusDeployConfig.



10
11
12
13
# File 'lib/physique/task_builders/octopus.rb', line 10

def initialize
  @apps = []
  @alias_tasks = true
end

Instance Attribute Details

#api_key=(value) ⇒ Object (writeonly)

The server name of the deployment server



7
8
9
# File 'lib/physique/task_builders/octopus.rb', line 7

def api_key=(value)
  @api_key = value
end

#server=(value) ⇒ Object (writeonly)

The server name of the deployment server



7
8
9
# File 'lib/physique/task_builders/octopus.rb', line 7

def server=(value)
  @server = value
end

Instance Method Details

#deploy_app {|config| ... } ⇒ Object

Yields:

  • (config)


20
21
22
23
24
# File 'lib/physique/task_builders/octopus.rb', line 20

def deploy_app
  config = OctopusDeployAppConfig.new
  yield config
  @apps << config
end

#no_alias_tasksObject

Do not alias the tasks without the ‘octo’ prefix.



16
17
18
# File 'lib/physique/task_builders/octopus.rb', line 16

def no_alias_tasks
  @alias_tasks = false
end

#optsObject

Raises:

  • (ArgumentError)


26
27
28
29
30
31
32
33
34
35
36
# File 'lib/physique/task_builders/octopus.rb', line 26

def opts
  raise ArgumentError, 'You must specify a server to deploy to' if @server.blank?
  raise ArgumentError, 'You must specify at least one application to deploy' if @apps.blank?

  Map.new({
    server: @server,
    api_key: @api_key,
    alias_tasks: @alias_tasks,
    apps: @apps.map { |a| a.opts }
  })
end