Class: Kybus::CLI::Bot::ComposefileGenerator

Inherits:
FileProvider show all
Defined in:
lib/kybus/cli/bot/file_providers/composefile_generator.rb

Constant Summary collapse

DB_SERVICES =
{
  'dynamoid' => <<-LOCALSTACK.chomp,
  'sequel' => <<-DATABASE.chomp
  db:
    image: postgres
    ports:
      - "5432:5432"
    environment:
      POSTGRES_DB: app_development
      POSTGRES_USER: user
      POSTGRES_PASSWORD: password
  DATABASE
}.freeze

Instance Method Summary collapse

Methods inherited from FileProvider

autoregister!, #bot_name, #bot_name_class, #bot_name_constantize, #bot_name_snake_case, #generate, #initialize, #keep_files

Constructor Details

This class inherits a constructor from Kybus::CLI::Bot::FileProvider

Instance Method Details

#make_contentsObject



38
39
40
41
42
43
44
45
46
47
# File 'lib/kybus/cli/bot/file_providers/composefile_generator.rb', line 38

def make_contents
  <<~DOCKERCOMPOSE + db_service_config
    version: '3'
    services:
      app:
        build: .
        volumes:
          - .:/app
  DOCKERCOMPOSE
end

#saving_pathObject



34
35
36
# File 'lib/kybus/cli/bot/file_providers/composefile_generator.rb', line 34

def saving_path
  'docker-compose.yml'
end

#skip_file?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/kybus/cli/bot/file_providers/composefile_generator.rb', line 30

def skip_file?
  !@config[:with_docker_compose]
end