Class: Physique::OctopusDeployAppConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MetadataConfig

#with_metadata

Constructor Details

#initializeOctopusDeployAppConfig

Returns a new instance of OctopusDeployAppConfig.



45
46
47
48
49
# File 'lib/physique/task_builders/octopus.rb', line 45

def initialize
  super
  @type = :console
  @lang = :cs
end

Instance Attribute Details

#lang=(value) ⇒ Object (writeonly)

The name for the build task



40
41
42
# File 'lib/physique/task_builders/octopus.rb', line 40

def lang=(value)
  @lang = value
end

#name=(value) ⇒ Object (writeonly)

The name for the build task



40
41
42
# File 'lib/physique/task_builders/octopus.rb', line 40

def name=(value)
  @name = value
end

#project=(value) ⇒ Object (writeonly)

The name for the build task



40
41
42
# File 'lib/physique/task_builders/octopus.rb', line 40

def project=(value)
  @project = value
end

#type=(value) ⇒ Object (writeonly)

The name for the build task



40
41
42
# File 'lib/physique/task_builders/octopus.rb', line 40

def type=(value)
  @type = value
end

Instance Method Details

#optsObject

Raises:

  • (ArgumentError)


51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/physique/task_builders/octopus.rb', line 51

def opts
  raise ArgumentError, 'You must specify a :project to deploy' if @project.blank?
  raise ArgumentError, 'You must specify the :type of project to deploy' if @type.blank?
  raise ArgumentError, "Project :type #{@type} is not supported." unless supported_types.include? @type

  project_file_path = Physique::ProjectPathResolver.resolve(@project, @lang)
  _, project_file = File.split project_file_path
  project_name = File.basename(project_file, '.*')

  Map.new({
    type: @type,
    name: @name || @project,
    project: project_name,
    project_file: project_file_path,
    metadata: @metadata
  })
end