Class: Brut::CLI::Apps::New::Segments::DockerDeploy

Inherits:
Base
  • Object
show all
Defined in:
lib/brut/cli/apps/new/segments/docker_deploy.rb

Instance Attribute Summary

Attributes inherited from Base

#project_root

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#create!, #output_post_add_messaging

Constructor Details

#initialize(project_root:, templates_dir:) ⇒ DockerDeploy

Returns a new instance of DockerDeploy.



5
6
7
8
# File 'lib/brut/cli/apps/new/segments/docker_deploy.rb', line 5

def initialize(project_root:, templates_dir:)
  @project_root  = project_root
  @templates_dir = templates_dir / "segments" / "DockerDeploy"
end

Class Method Details

.friendly_nameObject



2
# File 'lib/brut/cli/apps/new/segments/docker_deploy.rb', line 2

def self.friendly_name = "Generic Docker-based Deployment"

.segment_nameObject



3
# File 'lib/brut/cli/apps/new/segments/docker_deploy.rb', line 3

def self.segment_name = "docker-deploy"

Instance Method Details

#<=>(other) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/brut/cli/apps/new/segments/docker_deploy.rb', line 18

def <=>(other)
  if self.class == other.class
    0
  elsif other.class == Brut::CLI::Apps::New::Segments::Sidekiq
    # If both docker and sidekiq segments are activated, we want to do heroku first,
    # since Sidekiq will need to modify it.
    -1
  else
    1
  end
end

#add!Object



10
11
12
13
14
15
16
# File 'lib/brut/cli/apps/new/segments/docker_deploy.rb', line 10

def add!
  operations = copy_files(@templates_dir, @project_root)

  operations.each do |operation|
    operation.call
  end
end